get Route [filament.admin.auth.login] not defined. error

When changing user password I get error
Route [login] not defined.
Route [login] not defined.
so I try to create named route like this
Route::redirect('/login', Filament::getLoginUrl(), 301)->name('login');
Route::redirect('/login', Filament::getLoginUrl(), 301)->name('login');
but I got another error
Route [filament.admin.auth.login] not defined.
Route [filament.admin.auth.login] not defined.
Solution:
Solved by creating the named route ``` Route::get('/login', function () { $url = url()->previous(); $routeName = app('router')->getRoutes()->match(app('request')->create($url))->getName();...
Jump to solution
1 Reply
Solution
Ayman Alareqi
Ayman Alareqi16mo ago
Solved by creating the named route
Route::get('/login', function () {
$url = url()->previous();
$routeName = app('router')->getRoutes()->match(app('request')->create($url))->getName();
$panelId = explode('.', $routeName)[1];
$panel = Filament::getPanel($panelId);
Filament::setCurrentPanel($panel);
return redirect()->to(Filament::getLoginUrl());
})->name('login');
Route::get('/login', function () {
$url = url()->previous();
$routeName = app('router')->getRoutes()->match(app('request')->create($url))->getName();
$panelId = explode('.', $routeName)[1];
$panel = Filament::getPanel($panelId);
Filament::setCurrentPanel($panel);
return redirect()->to(Filament::getLoginUrl());
})->name('login');
Want results from more Discord servers?
Add your server