creativspeed/inertia-bundle
Modern Inertia.js integration for Symfony 8 - Build single-page applications with Vue.js/React without the complexity of APIs
161
| Install | |
|---|---|
composer require creativspeed/inertia-bundle |
|
| Latest Version: | v2.0 |
| PHP: | ^8.2|^8.3|^8.4 |
| License: | MIT |
| Last Updated: | Sep 4, 2026 |
| Links: | GitHub · Packagist |
Maintainer: CreativSpeed
Inertia Bundle for Symfony
Inertia.js for Symfony — build a Vue or React single-page app against your existing Symfony controllers, without hand-rolling a JSON API.
#[Route('/', name: 'home')]
public function index(InertiaInterface $inertia): Response
{
return $inertia->render('Home', [
'title' => 'Hello from Symfony!',
]);
}
Features
- Full Inertia.js v3 protocol — lazy, always, deferred (with groups), and merge/deep-merge props
- Automatic 302→303 redirect conversion and asset-version conflict handling (the two things every from-scratch integration forgets)
- Server-side rendering with a real body+head hand-off to your Twig shell
- Vite integration with automatic asset-version detection from the manifest
- Automatic auth data and flash message sharing on every response
back()/redirect()/location()/redirectWithErrors()helpers- History encryption (
encryptHistory()/clearHistory()) - A testing trait (
InertiaAssertionsTrait) for asserting on Inertia responses in PHPUnit
Requirements
- PHP 8.2+
- Symfony 7.0+ (including Symfony 8)
symfony/security-bundle(used for automatic auth-data sharing)
Install
composer require creativspeed/inertia-bundle
Not using Symfony Flex? Register it manually:
// config/bundles.php
return [
// ...
CreativSpeed\InertiaBundle\InertiaBundle::class => ['all' => true],
];
Then read docs/installation.md for the root template, config, and frontend setup — there's a couple of details there (specifically around the protocol_version setting) worth getting right the first time.
Documentation
| Installation | Root template, frontend setup, verifying it works |
| Configuration | Every inertia.yaml option, explained |
| Props | lazy(), always(), defer(), merge(), deepMerge() |
| Shared data | share(), automatic auth data, flash messages |
| Redirects | back(), redirect(), location(), form validation errors |
| Server-side rendering | Enabling SSR and what your SSR server needs to return |
| Testing | InertiaAssertionsTrait for PHPUnit |
| Upgrading from 1.x | The breaking changes in 2.0, and why |
Contributing
Issues and PRs welcome at github.com/CreativSpeed/inertia-bundle.
License
MIT.
Made by CreativSpeed · bachir@creativspeed.com
Related Packages
devwizardhq/laravel-localizer
Laravel Localizer bridges Laravel translations to your SPA frontend (React/Vue/I...
4,493
7
alisacorporation/inertia-codeigniter
Inertia.js v3 server-side adapter for CodeIgniter 4. Build single-page apps with...
13
0