Installation
1
Install dependencies
2
Setup root template
Next, create your By default, Inertia renders a If you change the
resources/views/app.htmlresources/views/app.htmlresources/views/app.blade.php root template. This root template will be loaded on the first page visit to your application.<div> element with an id of app as the mounting point for your JavaScript application. You may customize the id via HandleInertiaRequests::configurethe RootID field of inertia.Middlewarethe <x-inertia::app> component.id of the root element, be sure to update it client-side as well.By default, Inertia assumes your root template is named app (resources/views/app.htmlresources/views/app.htmlresources/views/app.blade.php). You may change this by overriding root_view on HandleInertiaRequestsvia the RootView field of inertia.Middlewareusing Inertia::setRootView().3
Register middleware
version() method for setting your asset version, as well as a share() method for defining shared data.a Version field for setting your asset version, as well as a Share field for defining shared data.a version() method for setting your asset version, as well as a share() method for defining shared data.Blade Directives
In Laravel PHP, prior to v3, Inertia used@inertiaHead and @inertia Blade directives to render head and body content. These directives are still supported but do not offer SSR head fallback content. The Blade components above are recommended for new Laravel PHP applications.
resources/views/app.blade.php
id by passing a value to the directive: @inertia('custom-app-id').
Other Frameworks
Inertia works with any server-side framework that implements the Inertia protocol. You may use one of the community adapters or build your own.Community Adapters
Adapters for Rails, Django, Phoenix, Symfony, and more.
Building an Adapter
Bring Inertia to a framework that doesn’t have an adapter yet.