tarek / fsa
Full Sanctum Authentication
Requires
- php: >=8.1
- laravel/framework: >=10.10
- laravel/sanctum: >=3.2
- laravel/socialite: >=5.6
This package is auto-updated.
Last update: 2024-05-15 02:18:33 UTC
README
FSA Package stands for Full Sanctum Authentication Package
FSA Features:
- Must Verify Email.
- Can Reset Password.
- Socialite Login.
Installation Guide
composer require tarek/fsa
php artisan vendor:publish --provider="Tarek\Fsa\FSAServiceProvider" or php artisan vendor:publish --tag=fsa
php artisan migrate
These credentials should be placed in your application's config/services.php
configuration file, depending on the providers your application requires
for Example
'<your-provider>' => [
'client_id' => env('<your-provider>_CLIENT_ID'),
'client_secret' => env('<your-provider>_CLIENT_SECRET'),
'redirect' => env('<your-provider>_REDIRECT'),
],
To reference your <your-provider>_CLIENT_ID
and <your-provider>_CLIENT_SECRET
and <your-provider>_REDIRECT
you have to adapt your .env
file and set your keys and values from your providers
for Example:
GOOGLE_CLIENT_ID=xyz GOOGLE_CLIENT_SECRET=123 GOOGLE_REDIRECT=<your-domain>/api/auth/<your-provider>/callback
Afterwards, include the authentication routes in your route/api.php
using:
require __DIR__ . '/Authentication/authentication.php';
Afterwards, Implement the following implementation in your Models/User.php
Model using:
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordImplementation;
implements MustVerifyEmail, CanResetPasswordImplementation
Then use Traits
use Illuminate\Auth\Passwords\CanResetPassword;
use Tarek\Fsa\Traits\Providers;
use Tarek\Fsa\Traits\CheckEmailVerifyImplementation;
use Tarek\Fsa\Traits\FsaProfile;
use CanResetPassword, FsaProfile, Providers, CheckEmailVerifyImplementation;
License
The FSA Package is open-sourced software licensed under the MIT license.