Skip to content

Commit 0daf7b7

Browse files
authored
Merge pull request #3 from chrysanthos/update-readme
Update docs
2 parents e08cfd5 + 42ee7ed commit 0daf7b7

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/chrysanthos/laravel-otp/fix-php-code-style-issues.yml?branch=main&label=code%20style)](https://github.com/chrysanthos/laravel-otp/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/chrysanthos/laravel-otp.svg?style=flat-square)](https://packagist.org/packages/chrysanthos/laravel-otp)
77

8-
This package lets you set up OTP verification on whenever a user is logged in.
8+
This package lets you set up an OTP verification process upon user login.
99

1010
## Installation
1111

@@ -21,15 +21,39 @@ You can publish the config file with:
2121
php artisan vendor:publish --tag="laravel-otp-config"
2222
```
2323

24-
This is the contents of the published config file:
24+
There are the contents of the published config file:
2525

2626
```php
2727
return [
2828

29+
/**
30+
* Whether the package will register the routes and listeners.
31+
*/
2932
'enabled' => false,
3033

34+
/**
35+
* The logo image to be shown above otp input.
36+
*/
37+
'logo' => null,
38+
39+
/**
40+
* The notification to be sent to the logged-in user.
41+
* Override this with your own implementation so that
42+
* you can customize the channels, message format etc.
43+
*/
3144
'notification' => \Chrysanthos\LaravelOtp\Notifications\SendOtpToUserNotification::class,
3245

46+
/**
47+
* The paths that should be protected by otp. This must be
48+
* relative paths with no slashes at the start of the string.
49+
* Use this option in case you have admin login area with tools
50+
* like Nova/Backpack/Filament and only nedd otp in the main site
51+
*
52+
* Sadly the paths must point to the uri path of the route that the login form is submitted to.
53+
*/
54+
'paths' => [
55+
'*',
56+
],
3357
];
3458
```
3559

@@ -44,6 +68,8 @@ php artisan vendor:publish --tag="laravel-otp-views"
4468
Add the RedirectToOtpPage Middleware to the routes you wish to be protected by OTP.
4569

4670
```php
71+
use Chrysanthos\LaravelOtp\Middleware\RedirectToOtpPage;
72+
4773
Route::middleware([
4874
'auth:sanctum',
4975
RedirectToOtpPage::class,
@@ -52,7 +78,7 @@ Route::middleware([
5278
});
5379
```
5480

55-
Customize the notification you wish to be sent by changing the notification key in the config.
81+
You may customize the notification by changing the `notification` key in the config.
5682
By setting the notification to a custom notification class you have full flexibility on how the notification is sent (Channels, Text, etc.)
5783

5884
```php

0 commit comments

Comments
 (0)