Laravel 8 Authentication using Jetstream Example
In this quick example, let's see laravel 8 authentication with jetstream. This post will give you simple example of laravel 8 auth with jetstream. you can see laravel 8 jetstream auth with livewire. i would like to share with you laravel 8 jetstream auth with inertia.
Few days ago laravel 8 released and they provide lot's of new update. laravel 7 was using laravel/ui for auth scaffolding and now laravel 8 introduce jetstream for login, registration, email verification, two-factor authentication, session management, API support and team management.
Laravel 8 jetstream designed by Tailwind CSS and they provide auth using livewire and Inertia. i will show you how to add auth in laravel 8. you can easily create laravel auth with jetstream step by step.
you can follow bellow step and get it laravel 8 authentication with jetstream using livewire and Inertia.
Laravel 8 Auth Scaffolding using Livewire Jetstream
Laravel Livewire is a library that makes it simple to build modern, reactive, dynamic interfaces using Laravel Blade, Laravel controller and Laravel validation.
Livewire provide way to write your ajax with laravel blade, validation and all, you can use as javascript framework. so let's see bellow step to create auth using laravel 8 livewire.
Install Laravel 8:
here, we need to install laravel 8 application using composer command.
composer create-project --prefer-dist laravel/laravel blog
Install Jetstream:
Now, in this step, we need to use composer command to install jetstream, so let's run bellow command and install bellow library.
composer require laravel/jetstream
Create Auth with Livewire:
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 livewire
OR
php artisan jetstream:install livewire --teams
Now, let's node js package:
npm install
let's run package:
npm run dev
now, we need to run migration command to create database table:
php artisan migrate
Now, you can run and check. they installed all views, actions and all in your laravel 8 application.
Laravel 8 Auth Scaffolding using Inertia Jetstream
Laravel Inertia is a templating language and Inertia is working with vue js.
Install Laravel 8:
here, we need to install laravel 8 application using composer command.
composer create-project --prefer-dist laravel/laravel blog
Install Jetstream:
Now, in this step, we need to use composer command to install jetstream, so let's run bellow command and install bellow library.
composer require laravel/jetstream
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
Now, let's node js package:
npm install
let's run package:
npm run dev
now, we need to run migration command to create database table:
php artisan migrate
Now, you can run and check. they installed all views, actions and all in your laravel 8 application.
Laravel 8 Jetstream Features
Laravel 8 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:
config/fortify.php
....
'features' => [
Features::registration(),
Features::resetPasswords(),
Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication(),
],
...
config/jetstream.php
....
'features' => [
Features::profilePhotos(),
Features::api(),
Features::teams(),
],
...
Now you can run your application by bellow command:
php artisan serve
now you can see layout bellow as here:
Home Page:
Login Page:
Register Page:
Dashboard Page:
Profile Page:
Team Page:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel 8 Create Custom Helper Functions Tutorial
- Laravel 8 Multiple Image Upload Tutorial
- Laravel 8 Image Upload Tutorial Example
- Laravel 8 Form Validation Example
- Laravel 8 CRUD Application Tutorial for Beginners
- Laravel 8 - Target class [ProductController] does not exist - Solved
- What's New in Laravel 8 | Laravel 8 New Features
- Laravel Automatic Daily Database Backup Tutorial
- Laravel Collection first() and firstWhere() Methods Example
- How to Add Text on Image in Laravel?