rawilk/profile-filament-plugin
Filament plugin that jumpstarts a user profile area with multi-factor authentication, password and session management, migrations, and sensible defaults—opinionated but customizable. Designed to remove boilerplate and integrate cleanly into your panel.
Installation:
composer require rawilk/profile-filament-plugin
php artisan vendor:publish --tag="profile-filament-migrations"
php artisan vendor:publish --tag="profile-filament-config"
php artisan migrate
Panel Registration (in AdminPanelProvider):
use Rawilk\ProfileFilament\ProfileFilamentPlugin;
public function panel(Panel $panel): Panel {
return $panel
->plugin(ProfileFilamentPlugin::make());
}
User Model Setup:
use Rawilk\ProfileFilament\Auth\Multifactor\Concerns\InteractsWithMultiFactorAuthentication;
use Rawilk\ProfileFilament\Auth\Multifactor\Contracts\HasMultiFactorAuthentication;
class User extends Authenticatable implements HasMultiFactorAuthentication {
use InteractsWithMultiFactorAuthentication;
}
Custom Login Page (optional but recommended for MFA):
use Filament\Auth\Pages\Login;
use Rawilk\ProfileFilament\Auth\Login\Concerns\HandlesLoginForm;
class CustomLogin extends Login {
use HandlesLoginForm;
}
Register in panel provider:
->login(CustomLogin::class)
Enable basic profile + MFA with email provider:
ProfileFilamentPlugin::make()
->multiFactorAuthentication([
\Rawilk\ProfileFilament\Auth\Multifactor\Providers\EmailAuthenticationProvider::make(),
]);
Profile Management:
php artisan vendor:publish --tag="profile-filament-views"
ProfileFilamentPlugin::make()
->profileFields([
\Filament\Forms\Components\TextInput::make('custom_field')
->required(),
]);
MFA Integration:
->multiFactorAuthentication([
\Rawilk\ProfileFilament\Auth\Multifactor\Providers\AppAuthenticationProvider::make(),
\Rawilk\ProfileFilament\Auth\Multifactor\Providers\WebAuthnAuthenticationProvider::make(),
])
->multiFactorAuthentication([
\Rawilk\ProfileFilament\Auth\Multifactor\Providers\WebAuthnAuthenticationProvider::make()
->withPasskeyLogin(),
])
Authentication Pipeline:
ProfileFilamentPlugin::make()
->sendLoginThrough([
\App\Actions\Auth\Login\CustomValidation::class,
\Rawilk\ProfileFilament\Auth\Login\AuthenticationPipes\AttemptToAuthenticateUser::class,
]);
Session Management:
ProfileFilamentPlugin::make()
->sessionManagement([
\Rawilk\ProfileFilament\Auth\Session\Concerns\HandlesSessionTimeout::class,
\App\Actions\Auth\Session\CustomLogout::class,
]);
ProfilePage) by publishing views and overriding methods.event(new \Rawilk\ProfileFilament\Events\MultiFactorAuthenticated($user));
$this->actingAs($user)
->withMfaEnabled()
->assertCanAccessProfile();
MFA Provider Conflicts:
multiFactorAuthentication() array.Missing User Model Trait:
Call to undefined method User::hasMultiFactorAuthentication()InteractsWithMultiFactorAuthentication trait to your User model.Login Page Mismatch:
HandlesLoginForm trait in custom login pages.Database Migrations:
Column not found: mfa_secretphp artisan migrate
ProfileFilamentPlugin::make()
->debug(true); // Logs MFA/Profile events to Laravel logs
$user->hasMultiFactorAuthentication(); // Returns bool
$user->getMultiFactorAuthenticationProviders(); // Returns array of enabled providers
$user->disableMultiFactorAuthentication();
$user->forceDeleteMultiFactorAuthentication();
Custom MFA Providers:
AbstractAuthenticationProvider:
class CustomProvider extends AbstractAuthenticationProvider {
public function verify($user, $code) { ... }
public function generateCode($user) { ... }
}
Profile Widgets:
ProfileFilamentPlugin::make()
->profileWidgets([
\App\Widgets\CustomProfileWidget::class,
]);
Session Customization:
ProfileFilamentPlugin::make()
->sessionManagement([
\App\Actions\Auth\Session\CustomTimeout::class,
]);
Email Templates:
php artisan vendor:publish --tag="profile-filament-views"
config/profile-filament.php:
'email' => [
'prefix' => 'app.Emails.',
'paths' => [
resource_path('views/vendor/profile-filament/emails'),
],
],
config/profile-filament.php:
'mfa' => [
'app' => [
'secret_length' => 8,
],
'email' => [
'code_expiry_minutes' => 10,
],
],
->webAuthn([
'require_https' => env('APP_ENV') !== 'local',
]);
'mfa' => [
'rate_limiting' => [
'max_attempts' => 3,
'decay_minutes' => 2,
],
],
How can I help you explore Laravel packages today?