Raviya Technical
Published in

Raviya Technical

Laravel Authentication | Laravel 8 Authentication using Jetstream Example

In this quick example, let’s see laravel 8 authentication with jetstream. This post will give you a simple example of laravel 8 auth with jetstream. you can see laravel 8 jetstream auth with livewire. I would like to share with you the laravel 8 jetstream auth with inertia.

A few days ago laravel 8 was released and they provide lots of new updates. laravel 7 was using laravel/ui for auth scaffolding and now laravel 8 introduces jetstream for login, registration, email verification, two-factor authentication, session management, API support, and team management.

Laravel 8 jetstreams were 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 the below step and get laravel 8 authentications 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 provides a way to write your ajax with laravel blade, validation, and all, you can use it as a javascript framework. so let’s see below the step to create auth using laravel 8 livewires.

Install Laravel 8:

here, we need to install the laravel 8 application using the composer command.

composer create-project --prefer-dist laravel/laravel blog

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.

composer require laravel/jetstream

Create Auth with Livewire:

now, we need to create authentication using the below command. you can create basic login, register, and email verification. if you want to create team management then you have to pass the additional parameter. you can see the below commands:

php artisan jetstream:install livewireORphp artisan jetstream:install livewire --teams

Now, let’s node js package:

npm install

let’s run the package:

npm run dev

now, we need to run the migration command to create a 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 the laravel 8 application using the composer command.

composer create-project --prefer-dist laravel/laravel blog

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.

composer require laravel/jetstream

Create Auth with Inertia:

now, we need to create authentication using the below command. you can create basic login, register, and email verification. if you want to create team management then you have to pass the additional parameter. you can see the bellow commands:

php artisan jetstream:install inertiaORphp artisan jetstream:install inertia --teams

Now, let’s node js package:

npm install

let's run the package:

npm run dev

now, we need to run the migration command to create a 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 features that are configurable. you can see there is a configuration file fortify.php and jetstream.php file where you can enable and disable options 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 below command:

php artisan serve

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store