Registration and Login with Username or Email

Filament 4/5
Also available in Filament 3 version

Allowing users to choose usernames requires custom Filament Login and Register forms that accept either username or email authentication, with modified login processes and username support in registration.

01J1FD7S8WCNBCP4N9PA6M4FND

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Registration and Login with Username or Email
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 172 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 172 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

To start with this, we have to add a custom login and registration page to our Panel Provider:

app/Providers/Filament/AdminPanelProvider.php:

use App\Filament\Pages\Login;
use App\Filament\Pages\Register;
 
// ...
 
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login(Login::class)
->registration(Register::class)
->colors([
'primary' => Color::Amber,
])
// ...

Next, we need to create these two pages:

php artisan make:filament-page Login
php artisan make:filament-page Register

This will create two files that we can modify and add our custom fields:

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.