A Filament plugin that adds an email verification alert to your admin panel. This plugin integrates seamlessly with Filament's design and provides an easy way to alert users about email verification.
You can install the package via composer:
composer require monzer/filament-email-verification-alert
In your FilamentServiceProvider
or any service provider where you configure your panel, add:
use Monzer\FilamentEmailVerificationAlert\EmailVerificationAlertPlugin; public function panel(Panel $panel): Panel{ return $panel ->plugins([ EmailVerificationAlertPlugin::make(), ]);}
EmailVerificationAlertPlugin::make()
Creates a new instance of the plugin.
->color('blue') // 'yellow', 'blue', or 'red'
Sets the color theme for the alert. Defaults to 'yellow'.
->persistClosedState() // Alert will stay hidden after being closed until the session ends
By default, the alert will reappear if the page is refreshed after closing. Using persistClosedState()
makes the closed state persist throughout the user's session.
->closable(false) // Removes the close button, making the alert persistent
By default, the alert shows a close button. You can disable it to make the alert persistent.
->placeholder(false) // Disables the loading placeholder
Control the visibility of the loading placeholder during lazy loading.
->verifyUsing(function($user) { // Custom verification logic $user->notify(new CustomVerificationNotification()); Notification::make() ->title(trans('filament-email-verification-alert::messages.verification.success')) ->success() ->send();})
Customizes how verification emails are sent.
By default the panels::topbar.start
hook is used to render the alert. But you can use any of the Render Hooks available in Filament using the renderHook()
method as:
->renderHookName('panels::body.start')
->renderHookScopes([ListUsers::class])
Limits where the alert appears. By default, shows on all pages.
->lazy(false) // Default is true
Controls whether the alert is lazy loaded.
use Monzer\FilamentEmailVerificationAlert\EmailVerificationAlertPlugin; public function panel(Panel $panel): Panel{ return $panel ->plugins([ EmailVerificationAlertPlugin::make() ->color('blue') ->persistClosedState() ->closable(true) ->placeholder(true) ->renderHookName('panels::body.start') ->renderHookScopes([ListUsers::class]) ->lazy(false) ->verifyUsing(function($user) { // Custom verification logic $user->notify(new CustomVerificationNotification()); Notification::make() ->title(trans('filament-email-verification-alert::messages.verification.success')) ->success() ->send(); }), ]);}
All methods return the plugin instance, allowing for method chaining:
EmailVerificationAlertPlugin::make() ->color('blue') ->persistClosedState() ->closable(true) ->placeholder(true) ->lazy(false) ->renderHookName('panels::body.start');
The MIT License (MIT). Please see License File for more information.