Route [login] not defined

I got Route [login] not defined I try do it like image but not solve.
No description
No description
31 Replies
Matthew
Matthew11mo ago
=>path('admin')
Alnuaimi
AlnuaimiOP11mo ago
the same error
No description
No description
Matthew
Matthew11mo ago
OH, well now that I see the url, this makes more sense Your token expired go to 127.0.0.1:8000/admin/login
Alnuaimi
AlnuaimiOP11mo ago
I updated the same user is login and I am doing reload page I got this error
Matthew
Matthew11mo ago
Did you go here? Otherwise try php artisan optimize again
Alnuaimi
AlnuaimiOP11mo ago
when reload again I went to http://127.0.0.1:8000/admin/login
Matthew
Matthew11mo ago
and still same error?
Alnuaimi
AlnuaimiOP11mo ago
no I want to update on user go dirct to that how do it
Matthew
Matthew11mo ago
I dont understand you friend
Alnuaimi
AlnuaimiOP11mo ago
look this error show when i update the user I login it
Matthew
Matthew11mo ago
To summarize, you get the error because 1) Your panel is still misconfigured 2) Cache (try running php artisan optimize)
Alnuaimi
AlnuaimiOP11mo ago
This error appears when I edit the user I am logged into
krekas
krekas11mo ago
please use search. such question was asked multiple times already
Alnuaimi
AlnuaimiOP11mo ago
ok friend
awcodes
awcodes11mo ago
Add this to your web.php routes file.
foreach (filament()->getPanels() as $panel) {
Route::redirect('/login', $panel->getPath() . '/login')->name('login');
}
foreach (filament()->getPanels() as $panel) {
Route::redirect('/login', $panel->getPath() . '/login')->name('login');
}
Alnuaimi
AlnuaimiOP11mo ago
Like that I got the same error ? This error appears when I edit the user I am logged into,
No description
krekas
krekas11mo ago
and you edit what? password?
Alnuaimi
AlnuaimiOP11mo ago
yes yes
awcodes
awcodes11mo ago
Yes like that. I would put it below the comment. But that will work.
Matthew
Matthew11mo ago
Then i think you need to log in again. IIrc Laravel changes the token of the authenticated user
Alnuaimi
AlnuaimiOP11mo ago
I want change url her? when update
No description
Matthew
Matthew11mo ago
@aw correct me if Im wrong :) what?
awcodes
awcodes11mo ago
What is happening is that when you change the password of the logged in user laravel will log them out because their token no matches. So it redirects to the login route. But since Filament can’t hijack that part of Laravel you have to solve the issue by creating a named redirect for login to the panel’s login route.
Alnuaimi
AlnuaimiOP11mo ago
How do it ?
krekas
krekas11mo ago
you already got answer with the code...
awcodes
awcodes11mo ago
The code I gave you for the web.php will fix it.
Alnuaimi
AlnuaimiOP11mo ago
After I click the Save button, it will navigate to http://127.0.0.1:8000/users. It should move to http://127.0.0.1:8000/login.
No description
No description
krekas
krekas11mo ago
check if this route is registered
awcodes
awcodes11mo ago
On the right side of that error page can you click the share link and paste that url here?
makmak
makmak10mo ago
Flare
Route [login] not defined. - The error occurred at http://initial-demo.local/student
Want results from more Discord servers?
Add your server