towhid

with out declaration in authservice provider is it work policy authorization ?

Posted 2 months ago by towhid
'App\Project'=>'App\Policies\ProjectPolicy',

is it work if any function call or metthod call ?

in projectpolicy file

   public function view(User $user, Project $project)
    {
        return  $project->user_id == $user->id;
    }

in projectController file

 public function view(Project $project)
    {

        $this->authorize('view', $project);
        return view('project.view')->withProject($project);
    }

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