FIX: allow menu registration only for logged user
This funcionality should be acomplished using "auth" middleware, however I am not sure if order of middlewares matter. For this case I have added one if to this middleware.
This commit is contained in:
@@ -16,12 +16,16 @@ class AdminMenuRegistrator
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
// register menu only of logged users
|
||||
if (!\Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$modules = \Module::enabled();
|
||||
|
||||
// iterate over all enabled modules
|
||||
foreach ($modules as $key => $module) {
|
||||
$handler = config($module->getName() . '.handler');
|
||||
|
||||
// try to register menus
|
||||
call_user_func([$handler, 'registerAdminMenu'], \Auth::user());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user