Laravel 9 Authentication using Jetstream Tutorial
https://www.itsolutionstuff.com/post/laravel-9-authentication-using-jetstream-tutorialexample.html
Last updated
https://www.itsolutionstuff.com/post/laravel-9-authentication-using-jetstream-tutorialexample.html
Last updated
Laravel jetstream cung cấp tính năng đăng nhập, đăng ký, xác minh email, xác thực hai yếu tố, quản lý phiên, API thông qua Laravel Sanctum và các tính năng quản lý nhóm có sẵn.
Hi Dev,
In this post, we will learn laravel 9 authentication with jetstream. This tutorial will give you a simple example of laravel 9 auth with jetstream. step by step explain laravel 9 jetstream auth with livewire. you can see laravel 9 jetstream auth with inertia. So, let's follow a few steps to create an example of laravel 9 jetstream auth example.
Laravel 9 jetstream was designed by Tailwind CSS and they provide auth scaffolding using livewire and Inertia. Laravel jetstream provides login, registration, email verification, two-factor authentication, session management, API via Laravel Sanctum, and team management features inbuilt.
So, If you want to use laravel pre-define auth scaffolding then just follow the tutorial and I will show you how to create auto with livewire and Inertia Vue using Jetstream.
Laravel 9 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 provides a way to write your ajax with laravel blade, validation, and all, you can use as a javascript framework. so let's see below step to create auth using laravel 9 livewire.
Install Laravel 9:
here, we need to install laravel 9 application using composer command.
Install Jetstream:
Now, in this step, we need to use the composer command to install jetstream, so let's run bellow command and install bellow library.
Create Auth with Livewire:
now, we need to create authentication using the bellow command. you can create basic login, register, and email verification. if you want to create team management then you have to pass the addition parameter. you can see bellow commands:
Now, let's node js package:
let's run package:
now, we need to run migration command to create database table:
Now, you can run and check. they installed all views, actions, and all in your laravel 9 application.
Laravel 9 Auth Scaffolding using Inertia Jetstream
Laravel Inertia is a templating language and Inertia is working with vue js.
Install Laravel 9:
here, we need to install laravel 9 application using composer command.
Install Jetstream:
Now, in this step, we need to use the composer command to install jetstream, so let's run the bellow command and install the bellow library.
Create Auth with Inertia:
now, we need to create authentication using the bellow command. you can create basic login, register, and email verification. if you want to create team management then you have to pass the addition parameter. you can see bellow commands:
Now, let's node js package:
let's run package:
now, we need to run migration command to create database table:
Now, you can run and check. they installed all views, actions, and all in your laravel 9 application.
Laravel 9 Jetstream Features
Laravel 9 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
config/jetstream.php
Run Laravel App:
All the required steps have been done, now you have to type the given below command and hit enter to run the Laravel app:
Now, Go to your web browser, type the given URL and view the app output:
Read Also: Laravel 9 Create Custom Helper Functions Example
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...