Small issue with Policy

Posted 1 year ago by tiagomatosweb

Hi all, I'm new at Policy in Laravel.

I have User Model and Project Model. To add images to a project the scenario must be:

  • User must be an applicant.
  • Project must have in_progress status

My ProjectPolicy file

public function addImages(User $user, Project $project)
    return $project->isApplicant($user) AND $project->status === 'in_progress' ;

My question is would you declare the project status statement in the policy layer?


Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.