How to fix Target class [Spatie\Permission\Middleware\PermissionMiddleware] does not exist.
I hope the code can run smoothly again, please help me, I've tried changing the code but it still doesn't work
How to fix Target class [Spatie\Permission\Middleware\PermissionMiddleware] does not exist.
I hope the code can run smoothly again, please help me, I've tried changing the code but it still doesn't work
Please check the Middleware folder name in spatie vendor folder.
Folder path => vendor -> spatie-> laravel-permission -> src -> Middleware/Middlewares
Then in Kernal.php change the Middleware folder name accordingly
protected $routeMiddleware = [ .... 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class, 'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class, ]