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']]);
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community