I'm creating a module hower after creating the permissions and make sure that they were check on Admin role, it keeps redirecting me to the dashboard.
Permission:
$group = PermissionFacade::add( 'carousel', function (PermissionGroup $group) { $group->label('Banners'); } ); $group->addPermission( 'carousel.index', function (Permission $permission) { $permission->label('carousel List') ->routes('carousel.index'); } );
Routes:
Route::middleware(['web', 'admin.auth']) ->prefix($baseAdminUrl) ->name('admin.') ->group(function () { Route::get('carousel', AvoRed\Banner\Http\Controllers\TableController::class) ->name('carousel.index'); });
Found the solution when looking to the banners module on github, it seems it needs to have the 'permission' middleware to check the permissions, admin.auth isnt enough
Source:
Yes you are right. I have a custom middleware `permission` to check against the route.
© AvoRed 2021 Privacy