Skip to content

Too few arguments to function PermissionMiddleware::handle(), 2 passed and 3 expected #2732

Answered by irpcpro
irpcpro asked this question in Q&A
Discussion options

You must be logged in to vote

thanks ..
yes after i tried i found the solution like this on bootstrap/app.php :

    ->withMiddleware(function (Middleware $middleware) {
        $middleware->alias([
            'role' => Spatie\Permission\Middleware\RoleMiddleware::class,
            'permission' => Spatie\Permission\Middleware\PermissionMiddleware::class,
            'role_or_permission' => Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class,
        ]);
    })

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@parallels999
Comment options

@irpcpro
Comment options

Answer selected by irpcpro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants