ibobdb / laravel-stisla
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Language:CSS
Requires
- laravel/fortify: ^1.8
This package is auto-updated.
Last update: 2024-04-04 10:47:37 UTC
README
LaravelStisla is an authentication starter,powered by Laravel Fortify.This packages can be used to start your project shorter,it include all feature that laravel recommended implementing yourself.
Instalation
To get started, you will need to install LaravelStisla using composer.This will install Laravel Fortify as well so.
composer require ibobdb/laravel-stisla
Next,run the install command:
php artisan LaravelStisla:install
This command will publish LaravelStisla providers,views and assets directory.
Install Stisla depencies. Go to stisla directory Public/stisla
.
yarn install
It will install all assets depedencies
Configuration
Add this to your FortifyServiceProvider.php
in the boot()
method.
Fortify::loginView(function () { return view('auth.login'); }); Fortify::registerView(function () { return view('auth.register'); }); Fortify::requestPasswordResetLinkView(function () { return view('auth.forgot-password'); }); Fortify::resetPasswordView(function ($request) { return view('auth.reset-password', ['request' => $request]); }); // Fortify::verifyEmailView(function () { // return view('auth.verify-email'); // }); // Fortify::confirmPasswordView(function () { // return view('auth.confirm-password'); // }); // Fortify::twoFactorChallengeView(function () { // return view('auth.two-factor-challenge'); // });
In the file RouteServiceProvider.php
public const HOME = '/home' //change to public const HOME = '/dashboard'
Add Routes routes/web.php
Route::middleware(['auth:sanctum', 'verified'])->group(function () { Route::get('/dashboard', function () { return view('pages.dashboard'); }); });
This allows you to attach the verified middleware to any of your routes
Features
By default, LaravelStisla is setup to handle the basic authentication functions (Login, Register, Password Reset) provided by Laravel Fortify.
Email Verification
To get started, ensure the emailVerification feature is enabled in your fortify configuration file's features array. Next, you should ensure that your App\Models\User
class implements the Illuminate\Contracts\Auth\MustVerifyEmail
interface.
use Illuminate\Contracts\Auth\MustVerifyEmail; class User extends Authenticatable implements MustVerifyEmail { ...
Stisla
Check full documentation stisla
Follow
This allows you to attach the verified middleware to any of your routes