Skip to content

Commit 4904e11

Browse files
authored
Update README.md
1 parent b881c89 commit 4904e11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ This package lets you setup your two factor authentication for your existing lar
1414

1515
## Installation
1616
**1. Composer Install**
17+
1718
```bash
1819
$ composer require thecodework/two-factor-authentication:0.1.0
1920
```
2021
Note: The current version of the package is beta release, so be careful before using it for production applications.
2122

2223
**2. Add Service Provider**
24+
2325
After requiring the package add `TwoFactorAuthenticationServiceProvider::class` into providors array in `app.php` confi file
2426

2527
```php
@@ -32,13 +34,15 @@ After requiring the package add `TwoFactorAuthenticationServiceProvider::class`
3234
```
3335

3436
**3. Run Migrations**
37+
3538
Now run the migration
3639
```bash
3740
$ php artisan migrate
3841
```
3942
It will use the default User model and adds two columns `is_2fa_enabled` and `secret_key`.
4043

4144
**4. Add `AuthenticatesUserWith2FA` trait in the LoginController**
45+
4246
Now the config file is placed. The last thing to do is addding `AuthenticatesUsersWith2FA` trait in the `Http/Controllers/Auth/LoginController.php` file which helps to stop user at verify-2fa page to enter TOTP token after each login.
4347

4448
The final snippet will look like this.
@@ -50,6 +54,7 @@ use AuthenticatesUsers, AuthenticatesUsersWith2FA {
5054
Note: Don't forget to include use statement `use Thecodework\TwoFactorAuthentication\AuthenticatesUsersWith2FA` in the header.
5155

5256
**5. Publish the ConfigFile**
57+
5358
Finally publish config file
5459
```
5560
$ php artisan vendor:publish --provider="Thecodework\TwoFactorAuthentication\TwoFactorAuthenticationServiceProvider" --tag=config

0 commit comments

Comments
 (0)