Route [filament.auth.login] not defined. Error

I am getting the following error. Route [filament.auth.login] not defined. This prevents me from logging in. I do not know how it happened. I'm running filament 3.0-stable
10 Replies
awcodes
awcodes16mo ago
Make sure your panel has ->default()
Faab007NL
Faab007NLOP16mo ago
Yes it has ->default()
return $panel
->default()
->id('techmin')
->path('techmin')
->login()
->colors([
'primary' => TechsCodeColors::BlueishPurple,
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->userMenuItems([
'account' => MenuItem::make()->url('techmin/profile'),
])
->navigationItems([
NavigationItem::make('Main Page')
->icon('heroicon-o-home')
->url('/techmin/plugin-pages/main-page')
->isActiveWhen(fn () => request()->is('techmin/plugin-pages/main-page'))
->visible(fn () => Auth::user()->hasPermissionTo(Permissions::PLUGIN_PAGE_VIEW) || Auth::user()->hasPermissionTo(Permissions::SUPERADMIN))
->group("Websites")
->sort(-10),
NavigationItem::make('Plugin Pages')
->icon('heroicon-s-puzzle')
->url('/techmin/plugin-pages')
->isActiveWhen(function (){
return (request()->is('techmin/plugin-pages') || request()->is('techmin/plugin-pages/*')) && !request()->is('techmin/plugin-pages/main-page');
})
->visible(fn () => Auth::user()->hasPermissionTo(Permissions::PLUGIN_PAGE_VIEW) || Auth::user()->hasPermissionTo(Permissions::SUPERADMIN))
->badge(fn () => PluginPage::query()->count())
->group("Websites")
->sort(-5),
])
->plugins([
// CuratorPlugin::make()
// ->label('Media')
// ->pluralLabel('Media'),
]);
return $panel
->default()
->id('techmin')
->path('techmin')
->login()
->colors([
'primary' => TechsCodeColors::BlueishPurple,
'danger' => Color::Rose,
'gray' => Color::Gray,
'info' => Color::Blue,
'success' => Color::Emerald,
'warning' => Color::Orange,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
])
->userMenuItems([
'account' => MenuItem::make()->url('techmin/profile'),
])
->navigationItems([
NavigationItem::make('Main Page')
->icon('heroicon-o-home')
->url('/techmin/plugin-pages/main-page')
->isActiveWhen(fn () => request()->is('techmin/plugin-pages/main-page'))
->visible(fn () => Auth::user()->hasPermissionTo(Permissions::PLUGIN_PAGE_VIEW) || Auth::user()->hasPermissionTo(Permissions::SUPERADMIN))
->group("Websites")
->sort(-10),
NavigationItem::make('Plugin Pages')
->icon('heroicon-s-puzzle')
->url('/techmin/plugin-pages')
->isActiveWhen(function (){
return (request()->is('techmin/plugin-pages') || request()->is('techmin/plugin-pages/*')) && !request()->is('techmin/plugin-pages/main-page');
})
->visible(fn () => Auth::user()->hasPermissionTo(Permissions::PLUGIN_PAGE_VIEW) || Auth::user()->hasPermissionTo(Permissions::SUPERADMIN))
->badge(fn () => PluginPage::query()->count())
->group("Websites")
->sort(-5),
])
->plugins([
// CuratorPlugin::make()
// ->label('Media')
// ->pluralLabel('Media'),
]);
The AdminPanelProvider It used to work. But now it does not anymore. And i have no idea what changed I did some debugging in filaments web.php and it gets the the login route registering part but when i try getting it using route() it says it does not exist
Faab007NL
Faab007NLOP16mo ago
When i list all routes using artisan route:list it does show up
Faab007NL
Faab007NLOP16mo ago
I actually found out that the route() function is not working at all Oh i finally fixed the issue Had a wrong route name in App\Exceptions\Handler.php Under the unauthenticated function. Don't remember if this is a thing added by filament or if i did it
wr.dev.br
wr.dev.br16mo ago
Hi @faab007nl . I am with the same ISSUE, but on my Handler.php do not have "unauthenticated" function? How fix it?
Faab007NL
Faab007NLOP16mo ago
Make sure that the route in app/Exceptions/Handler.php has the following format. filament.<oanel_name>.auth.login
Dennis Koch
Dennis Koch16mo ago
Check that you don't directly use route() inside the ServiceProvider/PanelProvider
Want results from more Discord servers?
Add your server