How To Authenticate Laravel With Jetstream

Hello Geek, In this tutorial, we will learn how to authenticate Laravel with Jetstream. I will walk you through a simple installation of laravel auth with Jetstream. We can see laravel jetstream authentication with inertia and livewire. So, to create an example of laravel jetstream auth, you simply need to follow a few steps.

You are aware that Laravel Jetstream includes many features such as login, registration, email verification, two-factor authentication, session management, API via Laravel Sanctum, and team management.
So, if you want to use Laravel’s pre-define auth scaffolding with Jetstream, just follow the tutorial and I’ll show you how to create auto with livewire and Inertia using Jetstream.

Livewire Jetstream Auth Scaffolding in Laravel

Laravel Livewire is a library that simplifies the creation of modern, reactive, dynamic interfaces with Laravel Blade, Laravel controller, and Laravel validation.

You can use Livewire as a javascript framework to write your ajax with Laravel blade, validation, and all. So, let’s take a look at the steps below to create auth using Laravel Livewire.

Laravel Installation

composer create-project laravel/laravel example-app

Install Jetstream

composer require laravel/jetstream

Create Auth with Livewire

php artisan jetstream:install livewire

Now, let’s node js package

npm install

Run package:

npm run dev

To create a database table, we must now run the migration command.

php artisan migrate

Laravel Auth Scaffolding using Inertia Jetstream

Install Laravel

composer create-project laravel/laravel example-app

Install Jetstream

composer require laravel/jetstream

Create Auth with Inertia

php artisan jetstream:install inertia

To create a database table, we must now run the migration command.

npm install

run package

npm run dev

To create a database table, we must now run the migration command.

php artisan migrate

You can now run and test.

Features of Laravel Jetstream

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(),
    ],
...

Run Laravel App

php artisan serve

Now, Enter the given URL into your web browser and view the app output.

http://localhost:8000/

All the best nerd!

Leave a Reply