['roles' => NULL] Call to a member function intersect() on null
rognoni opened this issue · 1 comments
rognoni commented
Using this routes configuration
Route::group(['middleware' => ['auth', 'roles'], 'roles' => NULL], function () {
you see this error browsing http://127.0.0.1:8000/admin
Call to a member function intersect() on null
This is a possible solution into CheckRole
//if ($request->user()->hasRole($roles) || !$roles) {
if (!$roles || $request->user()->hasRole($roles)) {
return $next($request);
}