chuoke / laravel-user-identify
Laravel multi auth providers.
Fund package maintenance!
:vendor_name
Requires
- php: ^8.0
- illuminate/contracts: ^8.37
- spatie/data-transfer-object: ^3.7
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- pestphp/pest: ^1.18
- pestphp/pest-plugin-laravel: ^1.1
- vimeo/psalm: ^4.8
README
NOT READY!!!!!!
Installation
You can install the package via composer:
composer require chuoke/laravel-user-identify
You can publish and run the migrations with:
php artisan vendor:publish --provider="Chuoke\UserIdentify\UserIdentifyServiceProvider" --tag="laravel-user-identify-migrations" php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="Chuoke\UserIdentify\UserIdentifyServiceProvider" --tag="laravel-user-identify-config"
This is the contents of the published config file:
return [
];
Add user_identify
guard provider to auth.php
config file like this:
// config/auth.php return [ 'defaults' => [ 'guard' => 'api', 'passwords' => 'users', ], 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'jwt', 'provider' => 'user_identify', ], ], 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], 'user_identify' => [ 'driver' => 'user_identify', 'model' => Chuoke\UserIdentify\Models\UserIdentify::class, // user identify model ], ], // ... ]; // AuthServiceProvider.php Auth::provider($this->app['config']['identify']['auth_provider_name'] /* or 'user_identify' */, function ($app, array $config) { return new UserIdentifyProvider( $app['hash'], $config['model'], $app['config']['identify']['user_model'] ); });
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.