https://github.com/hos3ein/novel-auth
Laravel authentication with Password or OTP or both and highly configurable
https://github.com/hos3ein/novel-auth
authentication laravel otp php
Last synced: 6 months ago
JSON representation
Laravel authentication with Password or OTP or both and highly configurable
- Host: GitHub
- URL: https://github.com/hos3ein/novel-auth
- Owner: hos3ein
- Created: 2021-07-19T10:15:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-19T06:12:17.000Z (over 3 years ago)
- Last Synced: 2025-06-13T19:53:33.810Z (about 1 year ago)
- Topics: authentication, laravel, otp, php
- Language: PHP
- Homepage: http://novel-auth.herokuapp.com
- Size: 156 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Novel Auth
[](https://packagist.org/packages/hos3ein/novel-auth)
[](https://packagist.org/packages/hos3ein/novel-auth)
[](https://packagist.org/packages/hos3ein/novel-auth)
[](https://packagist.org/packages/hos3ein/novel-auth)
[](https://packagist.org/packages/hos3ein/novel-auth)
[](https://packagist.org/packages/hos3ein/novel-auth)
* Laravel authentication with Password or OTP or both and highly configurable
## Sample
* Source: [NovelAuth sample with multiple guard](https://github.com/hos3ein/novel-auth-sample)
* Demo: [http://novel-auth.herokuapp.com/](http://novel-auth.herokuapp.com)
## Install
```shell
composer require hos3ein/novel-auth
```
```shell
php artisan vendor:publish --provider="Hos3ein\NovelAuth\NovelAuthServiceProvider"
```
```shell
php artisan migrate
```
## The Novel Auth Service Provider
The `vendor:publish` command discussed above will also publish the `App\Providers\NovelAuthServiceProvider` class. You
should ensure this class is registered within the `providers` array of your application's `config/app.php` configuration
file.
```php
'providers' => [
// ...
App\Providers\NovelAuthServiceProvider::class
]
```
Add `HasOtpCodes` and `NovelAuthAuthenticatable` to your eloquent model
```php
class User extends Authenticatable
{
use HasOtpCodes, NovelAuthAuthenticatable;
...
}
```
## Final step
Implement methods in `App\Actions\NovelAuth\OtpManager.php` in order to do how to send SMS or make a Call and others.
## License
The Novel-Auth is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).