Download the PHP package dcnl1980/authy without Composer
On this page you can find all versions of the php package dcnl1980/authy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dcnl1980/authy
More information about dcnl1980/authy
Files in dcnl1980/authy
Package authy
Short Description Plugin for enabling two-factor authentication in Laravel applications
License MIT
Homepage https://github.com/dcnl1980/laravel-twofactor-authentication
Informations about the package authy
Laravel Two-Factor Authentication
![StyleCI](https://styleci.io/repos/473authy()98032/shield?style=flat)
- Introduction
- Installation
- Modify Login Workflow
- Usage
- Add a new TwoFactor Authentication Provider
- Demo Application
Introduction
This plugins allows you to enable two-factor authentication in your Laravel applications.
Only Laravel 5.1 or greater supported
Installation
-
Use following command to install:
-
Add the service provider to your $providers array in config/app.php file like:
-
Add the alias to your $aliases array in config/app.php file like:
-
Run the following command to publish configuration:
-
Run the following command to migrate user table changes to database:
-
Add the following lines in your User model (e.g App\User.php)
-
Before the class declaration, add these lines:
- Now the change the class declaration. For example, if your class declaration is
-
then change it to this:
- Now change the import traits line accordingly in user model file. For example if the line is:
to
- Lastly, add/update $hidden variable to hide 'two_factor_options' field from any DB call for user detail:
Modifying Login Workflow
-
You need to add the following code to your
app\Http\Controllers\Auth\AuthController.php
. -
Add route to verify two-factor authentication token
- Create view file in
resources/views/auth/token.blade.php
. Change this accordingly for your application. I have used code from AdminLTE theme here.
Usage
-
Registering User
-
Send token via SMS
-
Send token via phone call
-
Validating two-factor token
- Deleting User
Add a new TwoFactor Authentication Provider
Currently this package uses two-factor authentication services from Authy. You can also implement another two-factor authentication provider by doing the following:
Demo Application
I have also implemented this package in a simple laravel application. You can view installation instructions here. Through this application, you can do:
- User login & registration.
- Enable/Disable two-factor authentication for a user.
All versions of authy with dependencies
nesbot/carbon Version ~1.2|~2.0
illuminate/support Version ~5.1|~5.2|~5.3|~5.4|~5.5|~5.6|~5.7|~5.8|~6.0|~7.0