Support the ongoing development of Laravel.io →
Configuration Packages Security
Last updated 9 months 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!

Full Stack Europe

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.

© 2023 Laravel.io - All rights reserved.