Support WireModel Your support ensures we remain accessible to all and continue spreading innovative ideas globally.

Support us

How to auto-login in local environment

Filament
How to auto-login in local environment

Details

Published

June 09, 2025

Last Update

June 09, 2025

Built with

Filament

Version

3.x

License

free

View on GitHub

Discussion

If you have any questions or suggestions about this example, feel free to open a discussion on GitHub

It's very, very annoying when we deal dozens of times interacting with our app in development and we have to fill the login form. Not only we have to type the same thing over and over, there's also the muscle memory needed to remeber the different users (with different roles etc).

What we explore today is a very convenient way of logging in an existing user after our migrations and seeders run.

Here's a shortcut to create the folder and file `app/Filament/Pages/Auth/Login.php`.

Copy the contents from the code explorer, and now you have convenient selector to populate your user in local environment.

Also, add the created Login page class as the page to be used by Filament for Login.

It's recommended you leave the query filtering by some values that will not exist in production, for the case you end up having you production environment set as local, to not expose all your users and email addresses!

Here's the code.

©WireModel2025, All rights reserved.