mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-12 10:10:59 +01:00
19 lines
269 B
PHP
19 lines
269 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Policies;
|
||
|
|
||
|
use App\Models\User;
|
||
|
|
||
|
trait SelfTrait
|
||
|
{
|
||
|
/**
|
||
|
* Ownership of single item condition
|
||
|
*
|
||
|
* @return bool
|
||
|
*/
|
||
|
protected function isHimself(User $user, mixed $item)
|
||
|
{
|
||
|
return $user->id === $item->id;
|
||
|
}
|
||
|
}
|