The easiest way to install inertia in laravel

In this section, we will see how to install quick inertia in Laravel with Jetstream. Inertia JS is a new approach to building SPA web apps. The good thing about inertia, you do not need to create API. You can write your code just like before in back end, for single page application you can use Vue JS, React JS, Svelte. Inertia is like modern way to create single app without much effort.


Create Laravel Project

Installing a fresh laravel project, so head over to the terminal, type the command, and create a new laravel app.

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


Installing Jetstream

You can use jetstream to install inertia. you already know how power full is jetstream scaffolding. in other hand if you try to install inertia from scratch it is little bit complex . you can see in link below

How to install Inertia js in Laravel 8 with Vue 3

composer require laravel/jetstream


Install Jetstream With Inertia

use any one for your requirements

php artisan jetstream:install inertia

php artisan jetstream:install inertia --teams


Installation NPM Dependence

Next, you need to install step by step install NPM dependence

npm install

or use npm install && npm run dev 

npm run dev

Run the migration

php artisan migrate

Now it installation is complete 🎉 , just run the server

php artisan serve