where can I set the redirect url after user logout?

when user logouts from the user menu in filament v3 dashboard it redirects the user to /admin/login page. is it possible to redirect the user to /login page ?
Solution:
finally I solved by naming the login redirect route : ```php Route::get('/admin/login', function () { return redirect()->to('login'); })->name('filament.admin.auth.login');...
Jump to solution
4 Replies
awcodes
awcodes8mo ago
Just setup a redirect in your web.php routes file.
KiaBoluki
KiaBoluki8mo ago
Thank you for your reply. I tried it this way :
Route::get('/admin/login', function () {
return redirect()->to('login');
});
Route::get('/admin/login', function () {
return redirect()->to('login');
});
but it throws this error :
// Symfony\Component\Routing\Exception\RouteNotFoundException
// PHP 8.2.4
// Laravel 10.30.1
Route [filament.admin.auth.login] not defined.
// Symfony\Component\Routing\Exception\RouteNotFoundException
// PHP 8.2.4
// Laravel 10.30.1
Route [filament.admin.auth.login] not defined.
I also tried to create a view in this path: resources/views/filament/admin/auth/login.blade.php and this path : resources/views/filament/pages/admin/auth/login.blade.php but it does'nt work too.
KiaBoluki
KiaBoluki8mo ago
it works fine when I logout from home page but the problem is when I try to logout from /admin panel
Solution
KiaBoluki
KiaBoluki8mo ago
finally I solved by naming the login redirect route :
Route::get('/admin/login', function () {
return redirect()->to('login');
})->name('filament.admin.auth.login');
Route::get('/admin/login', function () {
return redirect()->to('login');
})->name('filament.admin.auth.login');