Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Inertia Laravel

Inertia Laravel Laravel Package

inertiajs/inertia-laravel

The official Laravel adapter for Inertia.js. Build modern single-page apps using classic server-side routing and controllers—no API boilerplate. It serves JSON page props to Vue, React, or Svelte frontends while Laravel handles routing, middleware, and validation.

View on GitHub
Deep Wiki
Context7

Inertia.js Laravel Adapter is the official server-side adapter that connects Laravel applications to Inertia.js, letting you build single-page apps using classic Laravel controllers and routing—no separate API required. It handles the request/response layer, so your controllers return Inertia pages instead of JSON or Blade views.

  • Inertia::render() responses with automatic JSON/HTML switching
  • Shared props across all pages and lazy/closure prop evaluation
  • Validation error sharing and flash message integration
  • Asset versioning and partial reloads for efficient updates
  • Optional server-side rendering (SSR) support
Frequently asked questions about Inertia Laravel
How do I install and configure inertiajs/inertia-laravel?
Install it with Composer, register the HandleInertiaRequests middleware, and add a root Blade template that includes @inertia and @inertiaHead. You also need a JavaScript client such as @inertiajs/vue3, @inertiajs/react, or @inertiajs/svelte plus a front-end build pipeline. The Composer package is only the Laravel half of the integration, so plan for both artifacts.
Does Inertia.js for Laravel require a separate API?
No. Inertia keeps classic Laravel server-side routing and controllers, and controllers return Inertia::render responses with props instead of JSON API endpoints. That removes an API tier you would otherwise build and operate for routing, serialization, and token handling. It is best suited to monolith-style apps such as dashboards, admin consoles, and CRUD-heavy products.
Which front-end frameworks can I use with inertia-laravel?
The Laravel adapter works with the official Inertia JavaScript clients for Vue 3, React, and Svelte. The PHP package does not choose a front-end framework for you; your team's skills and build pipeline determine that. Pick one client and keep its major version aligned with the adapter.
Which Laravel and PHP versions does inertia-laravel support?
Supported Laravel and PHP versions are defined by the package's Composer constraints, so check Packagist and composer.json for the exact release you plan to use. Adapter majors track Inertia protocol and JavaScript client majors, so validate Laravel, PHP, and client versions together. Pin constraints and review upgrades rather than letting ^ ranges drift.
How do I test Inertia responses in Laravel without a browser?
Use AssertableInertia to assert the component name and props returned by a controller, and use assertInertiaFlash for flash data. loadDeferredProps() lets tests resolve deferred props, so QA can cover page behavior without a browser. This makes prop and component regressions much easier to catch during migration or refactoring.
Is inertia-laravel good for SEO, or do I need server-side rendering?
Inertia is a strong fit when SEO is not the primary channel, such as internal tools, admin consoles, SaaS dashboards, and CRUD products. If you need SEO or faster first paint, Inertia supports SSR, but that adds a Node process, a bundle artifact, and health-check concerns such as inertia:check-ssr. Decide who owns and monitors that runtime before committing.
What should I know before upgrading inertia-laravel v2 to v3?
The PHP adapter major is tied to JavaScript client majors and Inertia protocol features such as deferred props, once props, and scroll props. Upgrading one side without the other can cause silent prop or protocol drift, so use a documented lockstep upgrade policy. Pin versions, read the changelog, and schedule regular upgrade reviews because patch releases are frequent.
Can I use inertia-laravel if I also need a mobile app or partner API?
Inertia replaces a separate SPA plus JSON API for the web UI, but it does not remove the need for a real API when mobile apps, native clients, or partners consume your data. If a non-web consumer is required, you will likely maintain a JSON API alongside Inertia. That reduces the architectural savings, so confirm your consumer requirements first.
How do deferred props and once props work in inertia-laravel?
Deferred props, once() props, scroll and merge props, and flash data are Inertia protocol features encoded in the Laravel adapter and its JavaScript clients. They help you control payload size and avoid repeating expensive prop resolution, but they require the PHP adapter and JS client versions to stay aligned. In tests, loadDeferredProps() helps you assert deferred prop behavior.
What are alternatives to Inertia.js for Laravel single-page apps?
Common alternatives are Livewire for server-driven interactivity, a traditional Blade app, or a separate SPA with a JSON API secured by Laravel Sanctum. Inertia is a good middle ground when you want an app-like front end while keeping Laravel routing and controllers. Choose a separate API and SPA when the front end must be independently deployable by another team.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections