filament v4 $panel->login(Login::class) not working
Hi,
My app substitutes an older one where users had usernames instead of emails.
So in filament v2 or v3 I overwrite the Login class to avoid the form checking the email.
In fact I created a 'usuari' field instead of email field. This way I could check if the user already existed in the laravel User table and if not, import it from my legacy system.
The thing is that I substituted the Login class by calling $panel->login(Login::class) in AdminPanelProvider
use App\Filament\Pages\Auth\Login;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel->login(Login::class)
For some reason in filament v4 Login::class is never called and users cannot login without a proper formated email.
Does anybody know how can I reactivate the Login::class in filament v4?1 Reply
Ok, I reply myself. It looks like it already use my Login::class. In fact php artisan route:list shows my class as the controller.
admin/login ............filament.admin.auth.login › App\Filament\Pages\Auth\Login
What happes is that the structure of the class is very different now and SOME of the older methods I had overwriten exist any longer.
Former overwriten methodes:
protected function getForms()
But now the class has methods such as...
public function form(Schema $schema)
Now... it also has
protected function getCredentialsFromFormData(array $data)
public function authenticate()
But I don't know if they are even called because of the 2FA thing. I will look further to see what is going on..
Ok, overwriting the form function instead of getForms solved the problem.