https://github.com/worksome/laravel-mfa
A driver-based multifactor authentication package for Laravel
https://github.com/worksome/laravel-mfa
laravel mfa
Last synced: 5 months ago
JSON representation
A driver-based multifactor authentication package for Laravel
- Host: GitHub
- URL: https://github.com/worksome/laravel-mfa
- Owner: worksome
- License: mit
- Created: 2022-07-06T12:05:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T11:55:00.000Z (6 months ago)
- Last Synced: 2024-11-15T06:12:08.713Z (5 months ago)
- Topics: laravel, mfa
- Language: PHP
- Homepage:
- Size: 151 KB
- Stars: 6
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Laravel Multi-Factor Authentication
[](https://packagist.org/packages/worksome/laravel-mfa)
[](https://github.com/worksome/laravel-mfa/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/worksome/laravel-mfa/actions?query=workflow%3A"Static+Analysis"+branch%3Amain)
[](https://packagist.org/packages/worksome/laravel-mfa)A driver-based multi-factor authentication package for Laravel
## Installation
You can install the package via composer:
```bash
composer require worksome/laravel-mfa
```You can publish and run the migrations with:
```bash
php artisan vendor:publish --tag="mfa-migrations"
php artisan migrate
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="mfa-config"
```This is the contents of the published config file:
```php
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](config/mfa.php).
## Usage
```php
$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
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Owen Voke](https://github.com/owenvoke)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.