In this section, we will install Inertia JS in Laravel 9 . There are two simply way to install inertia using laravel breeze and jetstream package. In this tutorial we will see the both.
1) Install Inertia Using Laravel Breeze
Create Laravel Project
composer create-project --prefer-dist laravel/laravel inertia
Now, fill the details in env file.
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_name
DB_USERNAME=database_user_name
DB_PASSWORD=database_password
Install Laravel breeze
Next, you need to run below command in your terminal
composer require laravel/breeze --dev
Setup Breeze With Inertia
You need to setup inertia js , run below command.
php artisan breeze:install vue
// Or...
php artisan breeze:install react
npm install
npm run dev
php artisan migrate
1) Install Inertia Using Jetstream
Create Laravel Project
composer create-project --prefer-dist laravel/laravel inertia
Now, fill the details in env.
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_name
DB_USERNAME=database_user_name
DB_PASSWORD=database_password
Installing Jetstream
You may use Composer to install Jetstream into your new Laravel project:
composer require laravel/jetstream
Install Jetstream With Inertia
php artisan jetstream:install inertia
// Or...
php artisan jetstream:install inertia --teams
After installing Jetstream, you should install and build your NPM dependencies and migrate your database:
npm install
npm run dev
php artisan migrate
Read Also
Laravel 9 Inertia Vue 3 Integrating Dashboard Example
Laravel 9 Inertia Vue 3 DataTables Example
Laravel 9 Inertia Vue 3 File Upload Example
Laravel 9 Inertia Vue 3 Form Submit Example
Laravel 9 Inertia Vue 3 Search & Filter Example
Laravel 9 Install Inertia js Server-side rendering (SSR)
Laravel 9 with Inertia Vue 3 Implement Flash Message
Laravel 9 Inertia Vue 3 CRUD Tutorial Example
Laravel Inertia Vue 3 Form Validation
Laravel 9 Inertia Vue 3 Pagination Example
How to Delete Record in Laravel 9 with Inertia Vue 3