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
{{ message }}
This repository has been archived by the owner on May 19, 2020. It is now read-only.
I'm trying to use UserHasAnyRole on my middleware's controller like this
public function __construct() { $this->middleware('auth'); $this->middleware('has.anyroles:admin,medic'); }
then I went to the middleware and then, in the beginning of the handle function I dd($roles) and this is what it cointains: array:2 [▼ 0 => "admin" 1 => "medic" ]
on line 37 at $roles = call_user_func_array('array_merge', $roles); is where the exception jumps on array_merge(): Argument #1 is not an array
The text was updated successfully, but these errors were encountered:
Yes, I had to make a middleware on app>http>middlewares called UserHasAnyRole then I copied and pasted the same code from vendor>caffeinated>src>Middleware>UserHasAnyRole and deleted this line: $roles = call_user_func_array('array_merge', $roles);
then in your Kernel.php you must assign your new created middleware:
on $routeMiddleware:
I'm trying to use UserHasAnyRole on my middleware's controller like this
public function __construct() { $this->middleware('auth'); $this->middleware('has.anyroles:admin,medic'); }
then I went to the middleware and then, in the beginning of the handle function I dd($roles) and this is what it cointains:
array:2 [▼ 0 => "admin" 1 => "medic" ]
on line 37 at
$roles = call_user_func_array('array_merge', $roles);
is where the exception jumps on array_merge(): Argument #1 is not an arrayThe text was updated successfully, but these errors were encountered: