In Laravel 11, Jetstream is a scaffolding library that provides authentication and authorization management features, which allows users to login, register, forget password, reset password, email verification, edit profile.
Here are steps to install and setup jetstream auth scaffolding:
Step 1 – Download Laravel 11
Run the following composer command to download and setup laravel 11:
composer create-project --prefer-dist laravel/laravel LaravelJetStreamAuth
Step 2 – Initialize Database with Project
Edit .env file from root folder of laravel project and configure database details, something like this:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db name
DB_USERNAME=db user name
DB_PASSWORD=db password
Step 3 – Install Jetstream Auth
Run the following composer command to install jetStream auth:
composer require laravel/jetstream
Step 4 – Create Auth System using JetStream and livewire
Run the following jetstream and livewire command to create complete auth system in project:
php artisan jetstream:install livewire OR php artisan jetstream:install livewire --teams
Step 5 – Jetstream Configuration
Edit fortify.php file from config folder to configure jetstream in it, ,something like this:
'features' => [
Features::registration(),
Features::resetPasswords(),
//Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication(),
],
Step 6 – Run Migration Command
Run migration command to create tables in database:
php artisan migrate
Step 7 – Install NPM packages
Run the following npm command to install the npm package in the project:
npm install
npm run dev
Step 8 – Test Application
Run the php artisan serve command to start the application server:
php artisan serve
Hit http://127.0.0.1:8000/
URL on browser for testing a complete jetstream auth system.
In this tutorial guide, you learned how to implement login, registration, forgotten password and email verification features in Laravel 11 using Jetstream Auth.