id === $componentPlacement->load('resume')->resume->creator_id ? Response::allow() : Response::deny('You do not own the resume of the component placement.'); } /** * Determine whether the user can view the model. */ public function view(User $user, ResumeComponentPlacement $componentPlacement): Response { return $this->isCreator($user, $componentPlacement); } /** * Determine whether the user can create models. */ public function create(User $user): bool { return true; } public function createForResume(User $user, ResumeComponentPlacement $componentPlacement): bool { return $user->can('update', $componentPlacement->load('resume')->resume); } /** * Determine whether the user can update the model. */ public function update(User $user, ResumeComponentPlacement $componentPlacement): Response { return $this->isCreator($user, $componentPlacement); } /** * Determine whether the user can delete the model. */ public function delete(User $user, ResumeComponentPlacement $componentPlacement): Response { return $this->isCreator($user, $componentPlacement); } /** * Determine whether the user can restore the model. */ public function restore(User $user, ResumeComponentPlacement $componentPlacement): Response { return $this->isCreator($user, $componentPlacement); } }