mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-26 10:15:40 +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;
|
|
}
|
|
}
|