You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have multiple routes. Some of the routes are shared between the roles. and some are specific to a role.
I've created multi-level route groups, like the following code.
Route::middleware( 'role:super-admin' )->group( function () {
// Super Admin routesRoute::get( 'super-admin-route-1', function () { /**/ } );
Route::get( 'super-admin-route-2', function () { /**/ } );
Route::get( 'super-admin-route-3', function () { /**/ } );
// club admin and super admin shared routesRoute::middleware( 'role:club-admin' )->group( function () {
Route::get( 'club-and-super-admin-route-1', function () { /**/ } );
Route::get( 'club-and-super-admin-route-2', function () { /**/ } );
});
});
but the shared routes are not available to the outer level role i.e. super-admin, giving the error "403
USER DOES NOT HAVE THE RIGHT ROLES." They are only accessible to the inner level role, i.e. club-admin.
I know that what I can do is, put the shared routes in a separate route group outside of the outer route-group.
But I want to know that how can I achieve this using the multi-level route groups as shown in the above code.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have multiple routes. Some of the routes are shared between the roles. and some are specific to a role.
I've created multi-level route groups, like the following code.
but the shared routes are not available to the outer level role i.e.
super-admin
, giving the error "403USER DOES NOT HAVE THE RIGHT ROLES." They are only accessible to the inner level role, i.e.
club-admin
.I know that what I can do is, put the shared routes in a separate route group outside of the outer route-group.
But I want to know that how can I achieve this using the multi-level route groups as shown in the above code.
Beta Was this translation helpful? Give feedback.
All reactions