Table of Contents
For every web application – login & registration must be a needed part. Inside this article we will see Laravel 8 Authentication using Jetstream with Inertia Js. We will use Inertia Js in this tutorial for laravel 8 authentication which provides auth pages and is more comfortable with Vue Js.
Laravel founder Taylor otwell released laravel jetstream with Livewire & inertia Js with simple authentication scaffolding but poweful to use. Livewire is for Web and Inertia Js used to Vue Js.
Inside this we will see composer package for jetstream. Laravel 8 jetstream designed by Tailwind CSS. It publishes controllers for authentication system, views and routes to laravel application.
To Learn Laravel 8 authentication using Jetstream with Livewire Click here.
Let’s get started – Laravel 8 Auth Scaffolding using Inertia Js Jetstream
We will create laravel project using composer. So, please make sure your system should have composer installed. If not, may be this article will help you to Install composer in system.
Here is the command to create a laravel project-
$ composer create-project --prefer-dist laravel/laravel blog
To start the development server of Laravel –
$ php artisan serve
Assuming laravel already installed inside your system.
Database also configured with application.
We will use composer command to install jetstream library. Open project to terminal and hit this command into it.
$ composer require laravel/jetstream
While Installation you should see console screen like this.
Create Auth with Inertia Js
Now, we are going to install inertia via jetstream which will create authentication system for application. It consists of Login, Registration, Forgot Password, Profile, Dashboard, Two Setup authentication, Email verification etc.
To install Inertia –
$ php artisan jetstream:install inertia
When we install we should see console screen like in this way –
Next, we need to run command to install node js pacakges.
Installing Node Js Packages
Back to terminal and type this command and run.
$ npm install && npm run dev
This will give a screen view as –
Next, we need to migrate tables into database.
$ php artisan migrate
Generated Scaffolding Files
When we open jetsream.php file, we will see ‘stack’ => ‘inertia’, because we are using inertia as stack.
Configuration Files at /config
Feature List of authentication module
Action Files at /app/Actions
Blade Template Files or scaffolding files at /resources/js
Open project to terminal and type the command to start development server
$ php artisan serve
When we click on register link, it will open
For Login page,
We hope this article helped you to learn about Laravel 8 Authentication using Jetstream with Inertia Js in a very detailed way.
Online Web Tutor invites you to try Skillshare free for 1 month! Learn CakePHP 4, Laravel APIs Development, CodeIgniter 4, Node Js, etc into a depth level. Master the Coding Skills to Become an Expert in Web Development. So, Search your favourite course and enroll now. Click here to join.