This error shows when I log in with the admin profile. I declared the admin at but still giving me the error.
Kernel.php:
protected $routeMiddleware = [
'auth' => AppHttpMiddlewareAuthenticate::class,
'admin' => AppHttpMiddlewareAdminMiddleware::class,
'auth.basic' => IlluminateAuthMiddlewareAuthenticateWithBasicAuth::class,
'bindings' => IlluminateRoutingMiddlewareSubstituteBindings::class,
'can' => IlluminateAuthMiddlewareAuthorize::class,
'guest' => AppHttpMiddlewareRedirectIfAuthenticated::class,
'throttle' => IlluminateRoutingMiddlewareThrottleRequests::class,
];
and this is how web.php route looks like:
Route::middleware(['web', 'auth', 'admin'])->group(function () {
Route::get('/admin', [AdminDashboardController::class, 'index'])->name('admin.dashboard');
I tried to use some AI tools but no results. Please help me with this
New contributor
Jamal EL HAOUZI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.