impact-factoring / accounts-user-provider
A Laravel User provider for Impact Factoring Accounts
1.0.2
2024-05-15 08:44 UTC
Requires
- illuminate/cookie: ^11.7
- illuminate/support: ^11.7
- impact-factoring/accounts-client: ^1.0
- spatie/laravel-permission: ^6.7
This package is auto-updated.
Last update: 2024-05-15 08:44:36 UTC
README
Installation:
Install the package using Composer:
composer require impact-factoring/accounts-user-provider
After package installation, run the following commands:
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
php artisan migrate
Configuration
Once migration is done, update the following files:
In auth.php
:
Change the user provider driver from 'eloquent' to 'impact-factoring-accounts-user-provider':
'providers' => [
'users' => [
'driver' => 'impact-factoring-accounts-user-provider',
'model' => App\Models\User::class,
],
In User.php
:
Extend your local User model with the User model from the package:
use ImpactFactoring\Accounts\Models\User as Authenticatable;
Remove the $hidden
property.
In .env
:
Add the following environment variable:
IMPACT_FACTORING_ACCOUNTS_BASE_URL=<your_base_url_here>
Set this variable to where your local Accounts server is hosted. For example: http://localhost:8081
.
Authentication routes
This package contains two authentication routes:
- POST '/login' -> Process login request
- POST '/logout' -> Process logout request (route name: 'logout')
You are free to use whatever frontend you desire, but processing needs to be done by these two routes.