#Route [login] not defined

10 messages · Page 1 of 1 (latest)

open oracle
#

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?

river veldtBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

fast oriole
#

Check your routes/web.php

I suspect you have a welcome page at / still

open oracle
#

no, I add defualt guard in serivce proverider to admin guard

open oracle
#

add this in your AppServiceProvider register method.
config([
'auth.defaults.guard' => 'admin',
]);

fast oriole
#

Tht's a guard. what is in your web.php?

open oracle
#

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.

vast sonnet
#

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;

if ($this->isRequestFromFilament()) {
  config([
    'auth.defaults.guard' => 'admin',
]);
}
worthy gyro
#

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:

foreach (filament()->getPanels() as $panel) {
    Route::redirect('/login', $panel->getPath().'/login')->name('login');
}