backpack for laravel include permission manager routes in middleware

1k views Asked by At

I have two roles , super Admin & Admin , the first has access to all modules , admin only to some pages. I want the user when clicking on role or permission menu to get error 403 access denied.

my route group Admin.php:

Route::group(['middleware' => ['role:Super Admin,access_backend']], function(){

CRUD::resource('role', 'Backpack\PermissionManager\app\Http\Controllers\RoleCrudController');     <-----  i tried this with no success.

I need to include the 2 routes from permission manager located in Backpack\PermissionManager\app\Http\Controllers\

thanks in advance!

1

There are 1 answers

0
Bart Bergmans On

You need to add a \ in front of the namespace. Otherwise it will search for that class in your App namespace.

CRUD::resource('role', '\Backpack\PermissionManager\app\Http\Controllers\RoleCrudController');