whisper-money/app/Policies/AccountPolicy.php

21 lines
372 B
PHP

<?php
namespace App\Policies;
use App\Models\Account;
use App\Models\User;
use App\Policies\Concerns\HandlesUserOwnership;
class AccountPolicy
{
use HandlesUserOwnership;
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Account $account): bool
{
return $user->id === $account->user_id;
}
}