admin || $user->template_editor || $template->creator_id === $user->id; } /** * Determine whether the user can delete the model. * * @param \App\Models\User $user * @param \App\Models\Template $template * @return mixed */ public function delete(User $user, Template $template) { return $user->admin || $user->template_editor || $template->creator_id === $user->id; } }