Download the PHP package vormkracht10/filament-2fa without Composer
On this page you can find all versions of the php package vormkracht10/filament-2fa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vormkracht10/filament-2fa
More information about vormkracht10/filament-2fa
Files in vormkracht10/filament-2fa
Package filament-2fa
Short Description This package helps you integrate Laravel Fortify with ease in your Filament apps.
License MIT
Homepage https://github.com/vormkracht10/filament-2fa
Informations about the package filament-2fa
Filament Two Factor Authentication (2FA) plugin
This package adds Two Factor Authentication for your Laravel Filament app, using the first party package Laravel Fortify. We provide the views and logic to enable Two Factor Authentication (2FA) in your Filament app. Possible authentication methods are:
- SMS
- Authenticator app
Features and screenshots
Enable Two Factor Authentication (2FA)
Using authenticator app as two factor method
Using email or SMS as two factor method
Recovery codes
Two Factor authentication challenge
Installation
You can install the package via composer:
If you don't have Laravel Fortify installed yet, you can install it by running the following commands:
You can then easily install the plugin by running the following command:
Then add the plugin to your PanelProvider
:
Make sure your user uses the TwoFactorAuthenticatable
trait:
Also define the two_factor_type
cast on your user model:
❗ When using
fillable
instead ofguarded
on your model, make sure to addtwo_factor_type
to the$fillable
array.
Register the event listener
Laravel 11
In case you're using Laravel 11, you need to register the event listener in your AppServiceProvider
boot method:
Laravel < 11
In case you're not using Laravel 11 yet, you will probably need to manually register the event listener in your EventServiceProvider
:
If you want to customize the views (including email), you can publish them using the following command:
Usage
Configuration
The authentication methods can be configured in the config/filament-two-factor-auth.php
file (which is published during the install command).
You can simply add or remove (comment) the methods you want to use:
If you want to use the SMS method, you need to provide an SMS service. You can check the Laravel Notifications documentation for ready-to-use services.
Also make sure your user model has a phone
attribute.
Customization
If you want to fully customize the pages, you can override the classes in the config/filament-two-factor-auth.php
file:
Make sure you extend the original classes from the package.
Multi-tenant setup
If you're using Filament in a multi-tenant setup, you need to set the tenant
option to true
in the config/filament-two-factor-auth.php
file. You also need to set the userMenuItems
in your panel config. Take a look at the example below:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Baspa
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-2fa with dependencies
filament/filament Version ^3.0
filament/support Version ^3.2
laravel/fortify Version ^1.24
spatie/laravel-package-tools Version ^1.15.0