#The Middleware
class VerifyPermissionMiddleware
{
public function handle($request, Closure $next, $permission1, $permission2, $permission3)
{
return $next($request);
}
}
Jul 16, 2015
10
Level 10
How to get the 2 param for a Middleware?
Hi guys! I'm trying to build a VerifyPermissionMiddleware, but I can't get to work multiple parameters..
Here is the code:
#The Middleware
class VerifyPermissionMiddleware
{
public function handle($request, Closure $next, $permissions)
{
return $next($request);
}
}
#My route
get('users', ['middleware' => 'verify.permission:a,c,b']);
If I run a dd($permissions) in my middleware I just get the first parameter :(
Any clues of what am I doing wrong?
Level 26
@vitorarjol You can have an array if you wish
public function handle($request, Closure $next, ...$permissions)
1 like
Please or to participate in this conversation.