In this article, I will give you example of laravel 8.0 jetstream auth using inertia. We will implement a laravel 8.0 auth with inertia jetstream. This article goes into detail on laravel 8.0 auth with inertia tutorial. I explained simply step by step laravel 8.0 authentication inertia example.
Read also: How to create a laravel 8.0 project
Step 1: Install Laravel 8.0
composer create-project --prefer-dist laravel/laravel myBlog
Step 2: Install Jetstream
laravel authentication is the key Feature within a laravel project. To install Jetstream you have to install composer first. After that run this command
composer require laravel/jetstream
Step 3: Create Auth with Inertia
Now, we need to create authentication using bellow command. you can create basic login, register and email verification. if you want to create team management then you have to pass addition parameter. you can see bellow commands:
php artisan jetstream:install inertia
OR
php artisan jetstream:install inertia --teams
Step 4: Install node js package
npm install
Step 5: Run the node package
npm run dev
Step 6: Migrate by running
php artisan migrate
Laravel 8 Jetstream Features at a galance
Laravel 8.0 Jetstream provides new all feature are configurable. you can see there is a configuration file fortify.php and jetstream.php file where you can enable and disable option for that feature like:
config/fortify.php
'features' => [
Features::registration(),
Features::resetPasswords(),
Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirmPassword' => true,
]),
],
config/jetstream.php
'features' => [
Features::termsAndPrivacyPolicy(),
Features::profilePhotos(),
Features::api(),
//Features::teams(['invitations' => true]),
Features::accountDeletion(),
],
You can enable and disable features by commenting the line above.
Read also: Laravel 8.0 pagination example
Let’s check it
php artisan serve
Output
Read also: Generate pdf in laravel 8.0 using dompdf
Laravel Auth default pages are now provided by jetstream and its make our life better.
Registration page
http://127.0.0.1:8000/register
Login page
http://127.0.0.1:8000/login
Dashboard
http://127.0.0.1:8000/dashboard
Profile
http://127.0.0.1:8000/user/profile
Forgot Password
http://127.0.0.1:8000/forgot-password
Hope it will works!