Download the PHP package nytodev/inertia-bundle without Composer
On this page you can find all versions of the php package nytodev/inertia-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package inertia-bundle
Inertia.js Symfony Bundle
Symfony bundle implementing the Inertia.js v3 server-side protocol — the Symfony equivalent of inertiajs/inertia-laravel.
What is Inertia.js?
Inertia lets you build modern React, Vue, or Svelte single-page applications without building a separate API. You keep your Symfony controllers, routing, middleware, and authentication exactly as they are - controllers just return a component name and props instead of a Twig template.
On the first visit the server returns a full HTML page. On subsequent navigations it returns a lightweight JSON response and the JavaScript adapter swaps the component client-side without a full reload.
Requirements
PHP ^8.1 · Symfony ^6.4 / ^7.4 / ^8.0 · Twig ^3.0
Installation
Without Symfony Flex, register the bundle manually in config/bundles.php:
Quick start
1. Root Twig template
inertia(page) outputs <script data-page="app" type="application/json">...</script><div id="app"></div>.
inertiaHead(page) outputs SSR-rendered head tags (safe to include even without SSR).
2. Controller
3. JavaScript entry point (React)
4. A page component
That's it. The bundle handles first-visit HTML, subsequent XHR JSON responses, asset versioning, 302→303 redirect conversion, and partial reloads automatically.
Shared props
Set props that are available on every page (e.g. authenticated user, flash messages):
Prop types
| Method | Behaviour |
|---|---|
$inertia->lazy(fn) / optional(fn) |
Never sent on full render, only on explicit partial reload |
$inertia->always(fn) |
Always sent, even in partial reloads that filter other props |
$inertia->defer(fn) |
Fetched by the client in a separate XHR after page load |
$inertia->once(fn) |
Sent once, cached by the client |
$inertia->merge(fn) |
Merged into the existing client value (infinite scroll) |
Configuration
Documentation
| Topic | Link |
|---|---|
| Installation & configuration | docs/installation.md |
| Rendering & shared props | docs/rendering.md |
| All prop types | docs/props.md |
| Asset versioning, redirects, history | docs/features.md |
| Flash & validation errors | docs/flash-errors.md |
| Server-Side Rendering | docs/ssr.md |
| Testing | docs/testing.md |
License
MIT — see LICENSE.
All versions of inertia-bundle with dependencies
symfony/console Version ^6.4 || ^7.0 || ^8.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/framework-bundle Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/process Version ^6.4 || ^7.0 || ^8.0
symfony/twig-bridge Version ^6.4 || ^7.0 || ^8.0
symfony/twig-bundle Version ^6.4 || ^7.0 || ^8.0
twig/twig Version ^3.0