https://github.com/hennest/two-factor
Two-Factor Authentication for Laravel
https://github.com/hennest/two-factor
authentication laravel laravel-auth laravel-authentication two-factor two-factor-auth two-factor-authentication
Last synced: about 2 months ago
JSON representation
Two-Factor Authentication for Laravel
- Host: GitHub
- URL: https://github.com/hennest/two-factor
- Owner: Hennest
- Created: 2024-08-17T11:33:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T09:03:24.000Z (almost 2 years ago)
- Last Synced: 2024-08-28T10:27:26.048Z (almost 2 years ago)
- Topics: authentication, laravel, laravel-auth, laravel-authentication, two-factor, two-factor-auth, two-factor-authentication
- Language: PHP
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Two-Factor Authentication
This package provides a robust two-factor authentication (2FA) solution for Laravel applications using Google Authenticator.
## Installation
Install the package via Composer:
```bash
composer require hennest/two-factor
```
## Configuration
Publish the configuration file:
```bash
php artisan vendor:publish --tag=two-factor-config
```
This will create a `config/two-factor.php` file. Adjust the settings as needed.
## Database Migrations
Publish and run the migrations:
```bash
php artisan vendor:publish --tag=two-factor-migrations
php artisan migrate
```
## Usage
### Setup
1. Add the `HasTwoFactorAuthentication` trait to your User model:
```php
use Hennest\TwoFactor\Traits\HasTwoFactorAuthentication;
class User extends Authenticatable
{
use HasTwoFactorAuthentication;
// ...
}
```
## Customization
### Views
Publish the views to customize them:
```bash
php artisan vendor:publish --tag=two-factor-views
```
### Translations
Publish the language files to customize messages:
```bash
php artisan vendor:publish --tag=two-factor-lang
```
## Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This library is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).