usermp / laravel-login
Simple laravel login
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.2
- kavenegar/laravel: *
- laravel/framework: ^10.0
- laravel/passport: ^12.1
- sentry/sentry-laravel: *
This package is auto-updated.
Last update: 2024-05-23 05:44:17 UTC
README
This package provides a simple and secure login system for Laravel applications. It includes OTP verification and user authentication using Laravel Passport, with integration for Kavenegar for OTP sending and Sentry for error tracking.
Installation
To install the package, follow these steps:
-
Install the package via Composer:
composer require usermp/laravel-login:"dev-master"
-
Add the required environment variables to your
.env
file:# Constants for OTP settings OTP_TOKEN_EXPIRE_SECONDS=180 OTP_TOKEN_NUM_DIGITS=6 # Kavenegar API settings KAVENEGAR_API_KEY="" KAVENEGAR_SENDER="" # Sentry configuration SENTRY_LARAVEL_DSN="" SENTRY_TRACES_SAMPLE_RATE=1.0
-
Add the
LoginServiceProvider
class to the providers array in yourconfig/app.php
file:'providers' => [ // Other Service Providers Usermp\LaravelLogin\LoginServiceProvider::class, ],
-
Run the migrations to set up the necessary database tables:
php artisan migrate
-
Configure Laravel Passport:
php artisan passport:install
With these steps completed, your Laravel application is now equipped with a secure login system integrated with OTP verification.