Пример #1
0
 public function delete(Model $user) : bool
 {
     if (auth()->user() && auth()->user()->id === $user->id) {
         abort(406);
     }
     return parent::delete($user);
 }
Пример #2
0
 /**
  * @return \Illuminate\Database\Eloquent\Model|null
  */
 public function find(int $id)
 {
     return $this->rememberForever("find.{$id}", function () use($id) {
         return $this->dbRepository->find($id);
     });
 }