worksome / laravel-mfa
A driver-based multi-factor authentication package for Laravel
Fund package maintenance!
worksome
Installs: 35 811
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 7
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- laravel/framework: ^10.0 || ^11.0
- pragmarx/google2fa: ^8.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.6
- nunomaduro/collision: ^7.0 || ^8.1
- orchestra/testbench: ^8.0 || ^9.0
- pestphp/pest: ^2.33
- pestphp/pest-plugin-laravel: ^2.2
- worksome/coding-style: ^2.10
README
A driver-based multi-factor authentication package for Laravel
Installation
You can install the package via composer:
composer require worksome/laravel-mfa
You can publish and run the migrations with:
php artisan vendor:publish --tag="mfa-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="mfa-config"
This is the contents of the published config file:
return [ 'user' => \App\Models\User::class, 'channels' => [ \Worksome\MultiFactorAuth\Enums\Channel::Email->value => [ 'driver' => env('MFA_EMAIL_DRIVER', 'null'), ], \Worksome\MultiFactorAuth\Enums\Channel::Sms->value => [ 'driver' => env('MFA_SMS_DRIVER', 'null'), ], \Worksome\MultiFactorAuth\Enums\Channel::Totp->value => [ 'driver' => env('MFA_TOTP_DRIVER', 'null'), ], ], // ... ];
For the full configuration, see the config/mfa.php
file.
Usage
$twoFactorAuth = new \Worksome\MultiFactorAuth\MultiFactorAuth(); $response = $twoFactorAuth->sms->make( new \Worksome\MultiFactorAuth\DataValues\Sms\E164PhoneNumber('+14155552671'), ); dd($response);
The about
command
This package adds information to the artisan about
command. This information can be disabled by setting
the mfa.features.about_command
configuration to false
.
Testing
composer test
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
License
The MIT License (MIT). Please see License File for more information.