22 lines
413 B
PHP
Executable File
22 lines
413 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\User;
|
|
use App\Models\UserInterest;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
/**
|
|
* Policy for UserInterest model.
|
|
*/
|
|
class UserInterestPolicy
|
|
{
|
|
/**
|
|
* Determine whether the user can delete the model.
|
|
*/
|
|
public function delete(User $user, UserInterest $userInterest): bool
|
|
{
|
|
return $user->id === $userInterest->user_id;
|
|
}
|
|
}
|