This package seamlessly integrates two-factor authentication (2FA) into your Filament PHP applications using email verification codes. Enhance the security of your user accounts and protect sensitive data.
Filament applications handling sensitive user data. Projects requiring an extra layer of account security. Developers seeking a straightforward 2FA solution.
You can install the package via composer:
composer require solution-forest/filament-email-2fa
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-email-2fa-migrations"php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-email-2fa-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-email-2fa-views"
This is the contents of the published config file:
return [ 'code_table' => 'filament_email_2fa_codes', 'verify_table' => 'filament_email_2fa_verify', 'code_model' => \Solutionforest\FilamentEmail2fa\Models\TwoFaCode::class, 'verify_model' => \Solutionforest\FilamentEmail2fa\Models\TwoFaVerify::class, 'expiry_time_by_mins' => 10, '2fa_page' => \Solutionforest\FilamentEmail2fa\Pages\TwoFactorAuth::class, 'login_success_page' => \Solutionforest\FilamentEmail2fa\Pages\LoginSuccessPage::class,];
use Solutionforest\FilamentEmail2fa\FilamentEmail2faPlugin;Â return $panel // ... ->plugin(FilamentEmail2faPlugin::make());
Implement the 'RequireTwoFALogin' interface and use the 'HasTwoFALogin' trait
use Solutionforest\FilamentEmail2fa\Interfaces\RequireTwoFALogin;use Solutionforest\FilamentEmail2fa\Trait\HasTwoFALogin;Â class FilamentUser extends Authenticatable implements FilamentUserContract,RequireTwoFALogin{ use HasTwoFALogin;}