usermp/laravel-login

Simple laravel login

v1.0.0 2024-05-23 05:41 UTC

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:

  1. Install the package via Composer:

    composer require usermp/laravel-login:"dev-master"
  2. 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
  3. Add the LoginServiceProvider class to the providers array in your config/app.php file:

    'providers' => [
        // Other Service Providers
        Usermp\LaravelLogin\LoginServiceProvider::class,
    ],
  4. Run the migrations to set up the necessary database tables:

    php artisan migrate
  5. 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.