First hour of a new Filament project

Published on Jul 20, 2024

So you've just read through First hour of a new Laravel project, and you have decided to install Filament as an admin panel. Here are the steps I would take to configure a new Filament admin panel.

Unsaved changes alerts

When you have resources with long forms, it can be very painful to lose filled in data after accidentally closing a tab. After enabling this setting, Filament will ask the user for confirmation when they close a form that has changes.

// AppPanelProvider.php
 
public function panel(Panel $panel): Panel
{
return $panel
...
->unsavedChangesAlerts(); 
}
)

Allow password resets

By default, you can't reset your own password in a Filament admin panel. To give your users some autonomy, you can enable this feature.

// AppPanelProvider.php
 
public function panel(Panel $panel): Panel
{
return $panel
...
->passwordReset(); 
}
)

Enabling profile

In a similar vein, you can enable the user profile, so users can change their own email and password.

// AppPanelProvider.php
 
public function panel(Panel $panel): Panel
{
return $panel
...
->profile(); 
}
)

Top navigation

When you're starting out on a new project, you probably won't have that many menu items yet. You may want to enable top navigation to reclaim some horizontal space.

// AppPanelProvider.php
 
public function panel(Panel $panel): Panel
{
return $panel
...
->topNavigation(); 
}
)

Notifications

Most admin panels will send some form of notifications to their admins. By default, Filament will use Livewire's polling feature to check for new notifications. If you need real-time notifications, check out the docs to set up a websocket.

// AppPanelProvider.php
 
public function panel(Panel $panel): Panel
{
return $panel
...
->databaseNotifications() 
->databaseNotificationsPolling('30s'); 
}
)

Well, this probably took you less than an hour to configure. Good luck with your new Filament admin panel!

Do you have feedback or comments? Let me know on Twitter!