Route [login] not defined
please help! I have two guard and I use admin guard for Filament admin, and I use export action in header or bluck action, after success, in notification when click to open download file like .csv, redirect me to Route [login] not defined.
how I can solve it?

6 Replies
Check your routes/web.php
I suspect you have a welcome page at / still
no, I add defualt guard in serivce proverider to admin guard
add this in your AppServiceProvider register method.
config([
'auth.defaults.guard' => 'admin',
]);
Tht's a guard. what is in your web.php?
I don't have any routes in web.php to download file, I think that is a temporary solution, there is a depth problem that needs to be solved.
The main problem here is that I had the same problem and when I went deep into the files I saw that at some point it was controlling the web guard in a middleware (I don't remember which file it was in right now), which causes the problem mentioned when using a different guard.
I solved the problem by overriding the guard to update to “admin” if the request is coming from filament. Other than that, I haven't seen any solution or suggestion so far.
For this, I wrote a function that checks if there is a “filament” in the request and added it to the register in the AppServiceProvider file as;
It's just that the laravel default login route is
/login
but with filament we have only {panel}/login
so just add a route for login
to redirect to the {panel}/login
, e.g in the web.php:
or just:
if you have only one panel.