public function delete() { if (current_back_user() && current_back_user()->id === $this->id) { abort(406); } return parent::delete(); }
/** * @return \App\Services\Auth\Back\User|\App\Services\Auth\Front\User|null * * @throws \Exception */ function current_user() { if (request()->isFront()) { return current_front_user(); } if (request()->isBack()) { return current_back_user(); } throw new \Exception('Coud not determine current user'); }