stormcode/multi-login-methods

Simple package that allows to make classes for multiple login methods

Installs: 450

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/stormcode/multi-login-methods

1.4.2 2025-04-10 09:15 UTC

This package is auto-updated.

Last update: 2025-12-10 11:10:23 UTC


README

Installation

Install through Composer:

composer require stormcode/multi-login-methods

Add trait to your User model:

use StormCode\MultiLoginMethods\Traits\MultipleLoginMethods

Publish config, migration and view:

php artisan vendor:publish --provider=StormCode\MultiLoginMethods\MultiLoginMethodsServiceProvider

Migrate database:

php artisan migrate

Configuration

Whole configuration can be done trough the config file config/multiLoginMethods.php:

<?php
return [
    /**
     * Allowed login methods
     */
    'enabled_login_methods' => [
        StormCode\MultiLoginMethods\LoginMethods\EmailLogin::class,
        StormCode\MultiLoginMethods\LoginMethods\PasswordLogin::class,
        //StormCode\MultiLoginMethods\LoginMethods\SMSLogin::class
    ],

    /**
     * Drivers used to send emails, phones or other
     */
    'send_drivers' => [
        StormCode\MultiLoginMethods\LoginMethods\EmailLogin::class => \StormCode\MultiLoginMethods\SendDrivers\EmailDriver::class,
        //StormCode\MultiLoginMethods\LoginMethods\SMSLogin::class
    ],

    /**
     * User model settings
     */
    'auth_model' => \App\Models\User::class,
    'auth_model_table' => 'users',

    /**
     * Max and minimum number of numbers in code sent to email or phone
     */
    'minCodeLength' => 6,
    'maxCodeLength' => 6,

    /**
     * Allowed attempts count, after which login attempt will be blocked
     */
    'max_attempts' => 3,
];