In this tutorial you will learn about the Laravel 8 Auth with Livewire Jetstream Tutorial and its application with practical example.
In this Laravel 8 Auth with Livewire Jetstream Tutorial will show how to create user authentication system using livewire jetstream in laravel 8. In this tutorial you will learn to create user authentication in laravel using livewire jetstream package. We will create login, register, logout, forget password, profile and reset password page using laravel jetstream authentication scaffolding without using laravel 8 make:auth command. Jetstream auth with livewire is laravel package that enable us to generate default laravel authentication scaffolding. Laravel jetstream auth includes fully functional login, register, logout, reset password, forget password, email verification, two-factor authentication, session management.
Laravel 8 Auth with Livewire Jetstream Tutorial
In this article, you will learn to create Authentication using livewire Jetstream . In this step by step tutorial you will understand Laravel 8 Authentication using livewire Jetstream Example
Install Laravel 8:
First of all we need to create a fresh laravel project, download and install Laravel 8 using the below command
1 |
composer create-project --prefer-dist laravel/laravel blog |
Setup Database Credentials
Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.
1 2 3 4 5 6 |
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=lara8blog DB_USERNAME=root DB_PASSWORD= |
Install Jetstream:
In this step, we will install Jetstream Package via the composer dependency manager. Use the following command to install Jetstream.
1 |
composer require laravel/jetstream |
Create Auth with Livewire:
Now run following command install jetstream livewire to create basic authentication scaffolding login, register, logout and email verification views file:
1 2 3 4 5 |
php artisan jetstream:install livewire OR php artisan jetstream:install livewire --teams |
Now, install node js package:
1 |
npm install |
then run package:
1 |
npm run dev |
Now, run following command to migrate database schema.
1 |
php artisan migrate |
Jetstream Configuration
Next, we will open fortify.php file and will enable and disable option of jetstream package as per requirement, which is located inside config directory.
1 2 3 4 5 6 7 8 9 10 11 |
.... 'features' => [ Features::registration(), Features::resetPasswords(), Features::emailVerification(), Features::updateProfileInformation(), Features::updatePasswords(), Features::twoFactorAuthentication(), ], ... |
config/jetstream.php
1 2 3 4 5 6 7 8 |
.... 'features' => [ Features::profilePhotos(), Features::api(), Features::teams(), ], ... |
Run Development Server
Now we are ready to run our example so lets start the development server using following artisan command –
1 |
php artisan serve |
Now, open the following URL in browser to see the output –
1 |
http://127.0.0.1:8000/ |