creativspeed / inertia-bundle
Modern Inertia.js integration for Symfony 8 - Build single-page applications with Vue.js/React without the complexity of APIs
Package info
github.com/CreativSpeed/inertia-bundle
Type:symfony-bundle
pkg:composer/creativspeed/inertia-bundle
Requires
- php: ^8.2|^8.3|^8.4
- symfony/config: ^7.0|^8.0
- symfony/dependency-injection: ^7.0|^8.0
- symfony/filesystem: ^7.0|^8.0
- symfony/framework-bundle: ^7.0|^8.0
- symfony/http-kernel: ^7.0|^8.0
- symfony/security-bundle: ^7.0|^8.0
Requires (Dev)
- phpunit/phpunit: ^11.0
- symfony/phpunit-bridge: ^7.0|^8.0
- symfony/test-pack: ^1.2
Suggests
- symfony/http-client: Required if you want to use Server-Side Rendering (SSR)
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-04 21:03:32 UTC
README
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