In this tutorial you will learn about the Laravel 9 Auth Scaffolding using Jetstream Tutorial and its application with practical example.
In this Laravel 9 Auth Scaffolding using Jetstream Tutorial I will show how to create login, register, logout, forget password, profile and reset password page using laravel jetstream authentication scaffolding without using laravel 9 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.
In this laravel 9 jetstream auth scaffolding tutorial I will show you how to use jetstream and livewire package to create auth scaffolding in laravel 9. Jetstream auth will include login, register, reset the password, forget password, email verification, and two-factor authentication blade views and controller file.
Laravel 9 Auth Scaffolding using Jetstream Tutorial
In this step by step Laravel 9 Auth Scaffolding using Jetstream Tutorial I will demonstrate you to implement jetstream authentication scaffolding in laravel 9. Please follow the instruction given below:
- Install Laravel 9
- Database Configuration
- Install Auth Scaffolding Jetstream
- Install Livewire Package
- Jetstream Configuration
- Run PHP artisan Migrate
- Install Npm Packages
- Run Development Server
Install Laravel 9
First of all we need to create a fresh laravel project, download and install Laravel 9 using the below command
1 |
composer create-project --prefer-dist laravel/laravel Laravel9Auth |
Database Configuration
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=db name DB_USERNAME=db user name DB_PASSWORD=db password |
Install Auth Scaffolding 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 |
Install Livewire Package
Now run following command 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 |
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 |
'features' => [ Features::registration(), Features::resetPasswords(), //Features::emailVerification(), Features::updateProfileInformation(), Features::updatePasswords(), Features::twoFactorAuthentication(), ], |
Run php artisan Migrate
Now, run following command to migrate database schema.
1 |
php artisan migrate |
Install Npm Packages
1 |
npm install |
Then type the following command on cmd to run npm:
1 |
npm run dev |
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/ |