Inertia.js lets you build a full SPA on top of Laravel without creating a separate REST API. Controllers return React, Vue or Svelte page components with data instead of Blade views, and Inertia handles navigation without full page reloads. The result — one repository, one deployment, session-based authentication and 30–50% lower maintenance cost than a classic API-plus-SPA setup. This is the architecture behind our own products, OneCRMApp and FamilyTimelineApp.
Key takeaway: The short version — Inertia.js is the glue between Laravel and React. You keep Laravel routing, middleware, validation and session authentication; you get a React SPA without building or versioning an API. Choose it when the web app is your only client. Add SSR for public pages and SEO. Start new projects on Inertia.js v3.
What is Inertia.js?
Inertia.js is a library that connects a server-side framework with a client-side framework. It is not a framework and it does not replace Laravel or React — it defines how they communicate. A Laravel controller returns a page component name and its props; Inertia renders that component in the browser and handles navigation, history and form submissions. There is no REST API layer, no token authentication and no separate frontend repository.
Inertia was created by Jonathan Reinink and is maintained by the Inertia.js team. It supports Laravel, Rails, Django and Phoenix on the backend, and React, Vue and Svelte on the frontend. The Laravel adapter is first-class: inertiajs/inertia-laravel integrates with routing, middleware, validation, authorization and testing.
The best way to understand it is to compare the three common architectures
| Architecture | Repositories | Data layer | Best for |
|---|---|---|---|
| Blade + Livewire | One | PHP components | Internal panels, CRUD, SEO-heavy sites |
| API + SPA (React/Vue) | Two | REST/GraphQL + tokens | Mobile apps, multiple clients, public API |
| Inertia.js + React | One | Laravel controllers + props | Web apps with rich UI and one client |
How Inertia.js works
In a classic SPA the frontend talks to the backend through an API — endpoints, token authentication, error handling and a versioned contract to maintain. Inertia removes that layer. A Laravel controller returns a page component name and its data.
return Inertia::render('Orders/Index', [
'orders' => OrderResource::collection($orders),
'filters' => $request->only(['status', 'search']),
]);
On the React side the component receives the data as props.
export default function OrdersIndex({ orders, filters }) {
return (
<div>
<h1>Orders</h1>
<OrdersTable rows={orders.data} initialFilters={filters} />
</div>
);
}
The first visit is a normal HTML request. Laravel renders the root Blade template with the page object embedded as JSON. Every subsequent visit is an XHR request with the X-Inertia header; the server responds with JSON containing the component name, props, URL and asset version. Inertia swaps the component, updates the browser history and keeps the layout mounted.
The page object looks like this
{
"component": "Orders/Index",
"props": { "orders": { "data": [] }, "filters": {} },
"url": "/orders?status=paid",
"version": "b7c1f0a"
}
Three details matter in production
- Asset versioning.
HandleInertiaRequests::version()returns a hash of the built assets. When it changes after a deployment, Inertia performs a full page reload instead of mixing old JavaScript with new props. - Partial reloads. The client can request only selected props (
only: ['orders']) or exclude heavy ones (except: ['stats']). The server returns a partial JSON response and the page stays interactive. - Shared props. Data needed on every page (authenticated user, flash messages, navigation) is shared once in the middleware instead of being passed by every controller.
Inertia.js vs API plus SPA
| Criterion | Inertia.js | API + SPA |
|---|---|---|
| Repositories | One | Two (backend and frontend) |
| Authentication | Laravel session (simple) | Tokens (Sanctum, OAuth) |
| API contract | Does not exist | To design and version |
| Deployment | One | Two, version-coordinated |
| Mobile app | Not supported | Natural fit |
| Maintenance cost | 30–50% lower | Higher — two worlds |
| When to choose | One client (web), SaaS products | Mobile, many clients, public API |
The boundary is simple. As long as your web app is the only client, Inertia delivers every SPA benefit without the API layer. When a mobile app or a public partner API appears, you extract the API — and now it has a real consumer instead of a hypothetical one.
Tip: Do not build an API "for the future". Build it when the second client appears. A premature API is the most common way to double the maintenance cost of an application that only ever needed to serve a browser.
Inertia.js vs Livewire vs Next.js
| Criterion | Inertia.js + React | Livewire | Next.js + Laravel API |
|---|---|---|---|
| Language | PHP + React | PHP + Blade | PHP + React/Next |
| Rendering | Client-side + optional SSR | Server-driven HTML | SSR/SSG/ISR |
| SEO | Good with SSR | Good by default | Excellent |
| Real-time UI | React ecosystem | Livewire + Alpine | React ecosystem |
| Mobile client | Not supported | Not supported | Natural fit |
| Repositories | One | One | Two |
| Best for | SaaS, portals, rich web apps | Admin panels, CRUD, content sites | Content-heavy, multi-client products |
A common production setup is a hybrid: Livewire or Filament for the internal admin panel, Inertia + React for the customer-facing product. You get fast CRUD where nobody sees the UI, and a polished SPA where the user experience matters.
Quick start: install Inertia.js + React in Laravel 12/13
If you use a Laravel starter kit (React, Vue or Livewire), Inertia is already configured — you can skip to the project structure. The steps below show the manual setup so you understand what the starter kit does.
1. Create the Laravel application
composer create-project laravel/laravel inertia-react-app
cd inertia-react-app
2. Install the server-side adapter
composer require inertiajs/inertia-laravel
php artisan inertia:middleware
Register the middleware in bootstrap/app.php (Laravel 11+)
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
\App\Http\Middleware\HandleInertiaRequests::class,
]);
})
3. Create the root Blade view
resources/views/app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@viteReactRefresh
@vite(['resources/js/app.jsx'])
@inertiaHead
</head>
<body>
@inertia
</body>
</html>
4. Install the React adapter and Vite plugin
npm install @inertiajs/react react react-dom
npm install -D @vitejs/plugin-react
vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
laravel({
input: ['resources/js/app.jsx'],
refresh: true,
}),
react(),
],
});
5. Create the React entry point
resources/js/app.jsx
import '../css/app.css';
import { createInertiaApp } from '@inertiajs/react';
import { createRoot } from 'react-dom/client';
createInertiaApp({
resolve: (name) => {
const pages = import.meta.glob('./Pages/**/*.jsx', { eager: true });
return pages[`./Pages/${name}.jsx`];
},
setup({ el, App, props }) {
createRoot(el).render(<App {...props} />);
},
});
For production, replace { eager: true } with lazy imports so Vite splits each page into its own chunk
const pages = import.meta.glob('./Pages/**/*.jsx');
6. Create a route and a controller
use App\Http\Controllers\OrderController;
use Illuminate\Support\Facades\Route;
Route::get('/orders', [OrderController::class, 'index']);
public function index()
{
return Inertia::render('Orders/Index', [
'orders' => OrderResource::collection(
Order::query()->latest()->paginate(20)
),
]);
}
7. Create the page component
resources/js/Pages/Orders/Index.jsx
import { Link } from '@inertiajs/react';
export default function OrdersIndex({ orders }) {
return (
<main className="p-6">
<h1 className="text-2xl font-bold">Orders</h1>
<ul className="mt-4 divide-y">
{orders.data.map((order) => (
<li key={order.id} className="py-3">
<Link href={`/orders/${order.id}`}>
#{order.id} — {order.total}
</Link>
</li>
))}
</ul>
</main>
);
}
8. Run the app
npm run dev
php artisan serve
Open http://localhost:8000/orders. You now have a React page rendered by a Laravel controller, with no API route, no token and no second repository.
Warning: If you see a blank page, check three things: the root Blade view contains
@inertia, the page component path matches the string passed toInertia::render(), and the Vite dev server is running. In production, runnpm run buildbefore deploying.
Project structure
A scalable Inertia + React app keeps pages, layouts and shared components separate
resources/js/
├── app.jsx
├── Pages/
│ ├── Dashboard.jsx
│ ├── Orders/
│ │ ├── Index.jsx
│ │ ├── Show.jsx
│ │ └── Edit.jsx
│ └── Auth/
│ ├── Login.jsx
│ └── Register.jsx
├── Layouts/
│ ├── AuthenticatedLayout.jsx
│ └── GuestLayout.jsx
├── Components/
│ ├── OrdersTable.jsx
│ ├── Pagination.jsx
│ └── FormField.jsx
└── types/
└── inertia.d.ts
Conventions that prevent chaos
- Pages mirror controllers.
OrdersController@indexrendersOrders/Index;showrendersOrders/Show. - Layouts are persistent. The sidebar and top bar stay mounted between visits, so scroll position and local state survive navigation.
- Components are dumb. Pages fetch data through props; components receive data and callbacks. Business logic stays in Laravel.
- Types live next to the code. Shared TypeScript types for props, forms and enums prevent the "undefined is not a function" class of bugs.
Routing, links and navigation
Inertia uses Laravel routes. There is no client-side router to configure. Use the <Link> component for navigation and the router object for programmatic visits.
import { Link, router } from '@inertiajs/react';
<Link
href="/orders"
method="get"
preserveScroll
preserveState
prefetch="hover"
>
Orders
</Link>
router.post('/orders', data, {
preserveScroll: true,
onSuccess: () => form.reset(),
});
Useful visit options
preserveScroll— keep the scroll position (filters, pagination).preserveState— keep component state (search inputs).replace— replace the history entry instead of pushing a new one.only/except— request a partial reload.onSuccess,onError,onFinish— lifecycle callbacks.
For active navigation links, compare usePage().url with the link target. For modals and drawers, use preserveState and preserveScroll so closing the modal does not reset the page.
Forms and validation
The useForm hook is the standard way to submit forms. It tracks data, errors, processing state and upload progress.
import { useForm } from '@inertiajs/react';
export default function CreateOrder() {
const { data, setData, post, processing, errors, progress, reset } = useForm({
customer_id: '',
total: '',
notes: '',
});
function submit(event) {
event.preventDefault();
post('/orders', {
preserveScroll: true,
onSuccess: () => reset(),
});
}
return (
<form onSubmit={submit}>
<input
value={data.customer_id}
onChange={(e) => setData('customer_id', e.target.value)}
/>
{errors.customer_id && <p>{errors.customer_id}</p>}
<input
type="file"
onChange={(e) => setData('attachment', e.target.files[0])}
/>
{progress && <progress value={progress.percentage} max="100" />}
<button disabled={processing}>Save</button>
</form>
);
}
On the Laravel side, validate with a Form Request or $request->validate(). Inertia automatically converts a 422 response into the errors object.
public function store(StoreOrderRequest $request)
{
$order = Order::create($request->validated());
return redirect()
->route('orders.show', $order)
->with('success', 'Order created.');
}
For larger forms, the <Form> component (v2+) reduces boilerplate
import { Form } from '@inertiajs/react';
<Form action="/orders" method="post">
{({ errors, processing }) => (
<>
<input name="customer_id" />
{errors.customer_id && <p>{errors.customer_id}</p>}
<button disabled={processing}>Save</button>
</>
)}
</Form>
Tip: Never duplicate validation rules in React. The server is the source of truth. The client can show errors early, but Laravel must validate every request — including requests that do not come from your UI.
Shared data, authentication and layouts
Shared data is defined once in HandleInertiaRequests
public function share(Request $request): array
{
return [
...parent::share($request),
'auth' => [
'user' => $request->user()?->only('id', 'name', 'email'),
],
'flash' => [
'success' => fn () => $request->session()->get('success'),
'error' => fn () => $request->session()->get('error'),
],
];
}
Read it in React with usePage()
import { usePage } from '@inertiajs/react';
export default function Layout({ children }) {
const { auth, flash } = usePage().props;
return (
<div>
<header>{auth.user?.name}</header>
{flash.success && <p>{flash.success}</p>}
{children}
</div>
);
}
Authentication is ordinary Laravel session authentication. The React starter kit (Breeze) ships with login, registration, password reset, email verification and profile management. Protect routes with the auth middleware, authorize actions with policies and $this->authorize(), and never rely on hiding a button in React as a security measure.
Persistent layouts keep the shell mounted
Dashboard.layout = (page) => <AuthenticatedLayout>{page}</AuthenticatedLayout>;
In v3, useLayoutProps and setLayoutProps let layouts share dynamic data without an event bus. You can also set a default layout in createInertiaApp.
Data loading: deferred props, prefetching, polling and partial reloads
Inertia gives you several tools to keep pages fast without a client-side data-fetching library.
Deferred props load heavy data after the first render
return Inertia::render('Dashboard', [
'stats' => Inertia::defer(fn () => $this->stats()),
]);
import { Deferred } from '@inertiajs/react';
<Deferred data="stats" fallback={<Skeleton />}>
{(stats) => <StatsGrid stats={stats} />}
</Deferred>
Optional props are loaded only when the client asks for them (for example, inside a modal)
'audit' => Inertia::optional(fn () => $this->auditLog()),
Mergeable props append data for infinite scroll
'orders' => Inertia::merge(fn () => OrderResource::collection($orders)),
Partial reloads refresh selected props
router.reload({ only: ['orders'] });
Prefetching warms the next page on hover or mount
<Link href="/orders" prefetch="hover">Orders</Link>
Polling refreshes data on an interval
router.poll(5000, { only: ['stats'] });
Use polling sparingly — every poll is a request. Prefer server-sent events or WebSockets for real-time collaboration.
TypeScript
Inertia works well with TypeScript because props are plain objects. Define shared types once
import type { PageProps as InertiaPageProps } from '@inertiajs/core';
export interface User {
id: number;
name: string;
email: string;
}
export interface PageProps extends InertiaPageProps {
auth: { user: User | null };
flash: { success?: string; error?: string };
}
Use them in pages and forms
import type { PageProps } from '@/types';
export default function Dashboard({ auth }: PageProps) {
return <h1>Hello, {auth.user?.name}</h1>;
}
For forms, pass the shape to useForm
const form = useForm<{ name: string; email: string }>({
name: '',
email: '',
});
In v3, the <Form> component supports generics for type-safe errors and slot props. Generate types from Laravel with tools such as spatie/laravel-typescript-transformer if your API surface is large.
SSR and SEO
Inertia can render React on the server, so the browser receives HTML instead of an empty <div id="app">. SSR improves first paint, social previews and crawlability for public pages.
In v3, the @inertiajs/vite plugin handles SSR during development and simplifies the production build. In v2, you create a separate ssr.jsx entry and run vite build --ssr.
Production checklist
- Build the client and SSR bundles:
npm run buildandnpm run build:ssr(v2) or the v3 equivalent. - Run the SSR server under Supervisor or systemd:
php artisan inertia:start-ssr. - Set
INERTIA_SSR_URL(defaulthttp://127.0.0.1:13714) and keep the process alive. - Use
@inertiaHeadin the root Blade view and the<Head>component in React for title, meta description, canonical and JSON-LD. - Monitor the SSR process — if it dies, Inertia silently falls back to client-side rendering, and SEO suffers.
import { Head } from '@inertiajs/react';
<Head>
<title>Orders — Acme</title>
<meta name="description" content="Manage your orders." />
<link rel="canonical" href="https://example.com/orders" />
<script type="application/ld+json">
{JSON.stringify({ '@context': 'https://schema.org', '@type': 'WebPage' })}
</script>
</Head>
SEO checklist for an Inertia app
- Unique
<title>and meta description per page. - Canonical URL and
hreflangfor multilingual sites. - Structured data generated on the server (Article, Product, FAQPage, BreadcrumbList).
- A sitemap that includes every public URL.
- Semantic HTML and real links (
<a>via<Link>), not clickable divs. - Fast LCP, stable CLS and responsive INP.
- SSR for pages that must rank; a hybrid Blade + Inertia setup is acceptable for marketing pages.
Warning: Client-side-only Inertia pages can be indexed, but Google has to render JavaScript. For competitive queries, SSR plus server-generated meta tags is the safer default. Test with the URL Inspection tool and a JavaScript-disabled browser.
Performance optimization
Most Inertia performance problems come from oversized props and oversized bundles, not from Inertia itself.
- Split pages. Use lazy
import.meta.globso each page is a separate chunk. - Paginate and filter on the server. Never send 10,000 rows to the browser.
- Use API Resources. Select only the columns the UI needs.
- Defer heavy props. Load charts, audit logs and secondary panels after the first render.
- Prefetch likely next pages. Hover prefetch is cheap; mount prefetch is aggressive.
- Avoid N+1 queries. Eager load relations and use
withCount(). - Cache shared data. Do not run expensive queries in
share()on every request. - Measure. Lighthouse, WebPageTest, Laravel Pulse, Telescope and Debugbar.
A practical budget for a SaaS page: less than 200 KB of JavaScript (gzip) per route, LCP under 2.5 s on mobile, INP under 200 ms and CLS under 0.1. Track it in CI with Lighthouse CI.
Security
Inertia does not change Laravel's security model — it relies on it. The important rules
- Session authentication and CSRF. Inertia sends the
X-XSRF-TOKENheader automatically. Keep thewebmiddleware group and Laravel's CSRF protection. - Authorization on the server. Use policies, gates and
authorize()in controllers and Form Requests. Hiding a button in React is not authorization. - Validation on the server. Validate every request, including requests that bypass your UI.
- Mass assignment. Use
$fillableor$guardedand pass only validated data tocreate()andupdate(). - XSS. React escapes values by default. Avoid
dangerouslySetInnerHTML; sanitize any HTML you must render. - Sensitive props. Do not share secrets, password hashes or internal notes. Use
only/exceptand API Resources. - Rate limiting. Add
throttleto login, password reset and expensive endpoints. - File uploads. Validate MIME type and size, store files outside the public root and scan them if they are user-facing.
- Headers. Set CSP, HSTS,
X-Frame-OptionsandReferrer-Policyat the web server or middleware level.
Testing
Inertia responses are testable with the same tools as Blade views. The Laravel adapter ships with assertInertia.
use Inertia\Testing\AssertableInertia as Assert;
public function test_orders_index_renders_the_page(): void
{
$this->actingAs(User::factory()->create());
$this->get('/orders')
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Orders/Index')
->has('orders.data', 20)
->where('orders.total', 100)
);
}
Add three layers of tests
- Feature tests for controllers, validation, authorization and Inertia props.
- Page existence tests —
ensure_pages_existinconfig/inertia.phpcatches typos in component names. - Browser tests (Dusk or Playwright) for navigation, forms, file uploads and SSR.
Run the frontend build and SSR build in CI as well. A passing PHP test suite with a broken Vite build still ships a broken app.
Deployment
A production deployment has two artifacts: the PHP application and the frontend build.
composer install --no-dev --optimize-autoloader
npm ci
npm run build
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache
If you use SSR, also build and restart the SSR server
npm run build:ssr
php artisan inertia:start-ssr
Run the SSR process under Supervisor or systemd, restart it on every deploy, and add a health check. Serve public/build with a long-lived immutable cache — Vite fingerprints filenames, so this is safe. Put nginx or a CDN in front of static assets and keep the PHP-FPM pool sized for your traffic.
For zero-downtime releases, deploy into a new release directory and switch the symlink after the build and migrations finish. Keep the previous release for rollback, and restart queue workers and the SSR process as part of the release.
Inertia.js v3: what's new and how to upgrade
Inertia.js v3 is a major release focused on simplicity and developer experience. The headline changes
-
Vite plugin.
@inertiajs/viteresolves pages, handles lazy loading and configures SSR automatically.createInertiaApp()can run withoutresolveandsetupcallbacks. -
Axios removed. A built-in XHR client replaces Axios, shrinking the bundle. Axios interceptors can be migrated to the built-in client, or you can keep Axios through an adapter.
-
useHttphook. Standalone HTTP requests (search, API calls) get the same reactive state, error handling and upload progress asuseForm. -
Optimistic updates. Apply changes instantly and roll back automatically if the server rejects them.
-
Instant visits. Swap to the target component immediately while the server request runs in the background.
-
Layout props.
useLayoutPropsandsetLayoutPropsshare dynamic data between pages and persistent layouts. -
Exception handling.
handleExceptionsUsing()renders custom Inertia error pages with shared data. -
Nested prop types, default layouts, enum support, form generics,
preserveErrorsand ESM-only packages. -
Requirements: PHP 8.2+, Laravel 11+, React 19+ (React adapter) and Svelte 5+ (Svelte adapter).
Upgrade steps
npm install @inertiajs/react@^3.0
npm install @inertiajs/vite@^3.0
composer require inertiajs/inertia-laravel:^3.0
php artisan vendor:publish --provider="Inertia\ServiceProvider" --force
php artisan view:clear
npm run build
Breaking changes to check
Inertia::lazy()is removed — useInertia::optional().router.cancel()is nowrouter.cancelAll().- The
futureconfiguration block is removed; all v2 future flags are always enabled. - The config file structure changed — republish and re-apply customizations.
- The
inertiaattribute in the root Blade<head>is nowdata-inertia. hideProgress()andrevealProgress()named exports are removed — use theprogressobject.- React arrow-function layouts must be wrapped in an array:
Page.layout = [Layout]. - Form processing state now resets in
onFinish, not immediately on response.
Read the full Inertia.js v3 upgrade guide for a step-by-step migration with code examples.
When Inertia.js is the best choice
- SaaS products — subscription platforms with dashboards and rich interfaces.
- Client portals and B2B applications — where SPA smoothness matters but there is no separate frontend team.
- Replacing an old interface — modernizing Blade views into an SPA without rewriting the backend into an API (migration walkthrough).
- Ambitious MVPs — start in one repository, extract an API later if needed.
When is Inertia not the right call?
When you need a mobile app or a public multi-partner API from day one, or when the frontend has its own team and release cycle. Then the API-and-Sanctum model is the better fit. Compare the alternatives: Inertia.js vs Livewire, Inertia.js vs Next.js and Sanctum SPA vs Inertia session auth.
What an Inertia.js SPA costs
Rough ranges, net + VAT, at our 90–160 PLN/h rate
- A simple product with 5–10 screens — 15,000–30,000 PLN (€3,500–7,000), 3–5 weeks.
- An extended SaaS with roles and an admin panel — 30,000–60,000 PLN (€7,000–14,000), 6–10 weeks.
- Migrating an existing Blade app to Inertia — scoped after an audit, usually 2,000–8,000 PLN (€450–1,900) per module.
Compare that with the API-plus-SPA model, where the API layer and dual deployment typically add 20–40% to maintenance cost. We describe the full decision framework in our Polish guide to choosing a Laravel frontend.
Our products built with Inertia.js
We do not describe theory — we run this architecture in production. OneCRMApp is a CRM for insurance agents built with Laravel 12, React and Inertia.js — roles, calendar, settlements and reporting. FamilyTimelineApp is a family timeline app on the same stack plus an Android client (Capacitor). Both prove that Inertia works for products with real traffic and a multi-year roadmap.
What this means for your project: the patterns in this guide are not theoretical. They survived real users, real deployments and real maintenance cycles. We have made the mistakes so you do not have to.
Common mistakes
- Building an API "for the future". It doubles the surface area before the second client exists.
- Sending entire models as props. Use API Resources and select only what the UI needs.
- Skipping partial reloads. A filter change should not reload the whole page.
- Forgetting SSR for public pages. Client-only rendering is a handicap in competitive SERPs.
- Putting business logic in React. Validation, authorization and calculations belong in Laravel.
- Duplicating validation rules. The server is the source of truth.
- Not testing Inertia responses. A page can render the wrong component and still return 200.
- Ignoring asset versioning. Users get a mix of old JavaScript and new props after a deploy.
- Using Inertia for a public API or mobile app. That is what APIs are for.
- Not monitoring the SSR process. A dead SSR server silently degrades SEO and first paint.
FAQ
What is Inertia.js in Laravel?
Inertia.js is a library that connects a Laravel backend with React, Vue or Svelte components without a REST API layer. Controllers return page components with data, and Inertia handles SPA navigation in the browser.
Is Inertia.js a framework?
Not exactly — Inertia is the glue between backend and frontend. It does not replace Laravel or React; it defines how they communicate. Routing, authentication and business logic stay in the backend framework.
Inertia.js or Livewire?
Livewire is simpler and sufficient for internal panels — everything in PHP. Inertia delivers a full SPA with React/Vue and fits products with rich interfaces. A common setup is Livewire for the admin panel plus Inertia for the product itself.
Is Inertia.js suitable for large applications?
- Yes — with good practices: component splitting, deferred props for heavy data, SSR for public pages, caching and pagination. SaaS products with thousands of users run on Inertia, including ours.
Is Inertia.js SEO friendly?
Yes, with SSR enabled and proper meta tags and structured data generated server-side. Without SSR the app can still be indexed, but SSR gives faster first render and better Core Web Vitals. See the Inertia.js SEO guide.
How much does it cost to adopt Inertia.js in an existing project?
Migrating Blade views to Inertia usually costs 2,000–8,000 PLN net + VAT per module, depending on interface complexity. The backend, models and permissions stay unchanged, so the risk is far lower than rewriting onto a separate API.
Do I need an API with Inertia.js?
No. Inertia replaces the API layer for the web client. You only need an API when a second client appears — a mobile app, a partner integration or a public developer API.
Can I use Inertia.js with React 19?
Yes. The React adapter supports React 19; Inertia.js v3 requires React 19+. If you are on React 18, stay on Inertia v2 until you upgrade React.
What is the difference between Inertia.js and React?
React is a UI library. Inertia.js is the transport layer between Laravel and React. You still write React components; Inertia tells them which page to render and passes props from Laravel.
Is Inertia.js frontend or backend?
Both. The Laravel adapter is backend code; the React adapter is frontend code. Inertia is the protocol that connects them.
Does Inertia.js work with TypeScript?
Yes. Props are plain objects, so you can type pages, shared props and forms. The v3 <Form> component supports generics for type-safe errors.
How do I upgrade to Inertia.js v3?
Install @inertiajs/react@^3, @inertiajs/vite@^3 and inertiajs/inertia-laravel:^3, republish the config, update the root Blade view and test SSR, forms and layouts. The full checklist is in the v3 upgrade guide.
Is Inertia.js still maintained?
Yes. Inertia.js is actively maintained, with v3 released and first-class Laravel support. The project has a large community and is used by Laravel starter kits.
Can I use Inertia.js with a mobile app?
Not directly. Inertia is designed for a browser client. If you need a mobile app, extract an API (Sanctum or OAuth) and use Inertia for the web client only.
What is the learning curve?
For a Laravel developer, a few days to productivity. The mental model is simple: controllers return pages, pages receive props. The hard parts are SSR, performance and testing — not the basics.
How do I handle authentication?
Use Laravel's session authentication (Breeze or the React starter kit). Protect routes with the auth middleware, authorize with policies and never rely on the frontend for access control. See the authentication guide.
How do I deploy an Inertia.js app?
Build the frontend, cache Laravel config/routes/views, run the SSR server under Supervisor if you use SSR, and serve the hashed assets with a long cache. The deployment section above has the full command sequence.
How do I test an Inertia.js app?
Use assertInertia in Pest/PHPUnit for props and components, page existence tests for component names, and Dusk or Playwright for browser flows. See the testing guide.
What are the alternatives to Inertia.js?
Livewire (PHP-driven UI), API + React SPA (separate repositories), Next.js with a Laravel API, and classic Blade. The right choice depends on the number of clients, SEO needs and team structure.
Is Inertia.js production-ready?
Yes. It powers production SaaS products, including our own. The risks are operational — SSR process, asset versioning, oversized props — not architectural.
Sources
- Inertia.js documentation
- Inertia.js v3 upgrade guide
- Laravel documentation
- Laravel starter kits
- React documentation
- Vite documentation
- Inertia.js v3 announcement
Planning a SaaS product on Laravel and React? Check our Laravel development services or hire a Laravel developer — estimates are free.
Read more: Inertia.js v3 upgrade guide, Inertia.js authentication, Inertia.js SEO, Inertia.js performance and Inertia.js CRUD tutorial.
📖 See also: Laravel for startups — from MVP to scale.