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
Requires
- php: ^8.3
- laravel/framework: ^12
- spatie/laravel-package-tools: ^1.92
Requires (Dev)
- phpunit/phpunit: ^11.0.1
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, ];