Support the ongoing development of Laravel.io →
Configuration Packages Security
Last updated 1 year ago.
0

I suggest you to try this code for middleware

$this->middleware('permission:role-list');
         $this->middleware('permission:role-create', ['only' => ['create','store']]);
         $this->middleware('permission:role-edit', ['only' => ['edit','update']]);

 
         $this->middleware('permission:role-delete', ['only' => ['destroy']]); 
0

I am not using Permissions, I am just using the roles because I don't know how to attach many permissions to the roles. Maybe we are required to make a crud for that. By the way kindly tell if there is any way to do it using the roles only.. Thanks in advance. I am newbie

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.