mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-05 14:51:01 +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;
|
|
}
|
|
}
|