nytodev / inertia-bundle
Symfony Bundle implementing the Inertia.js v2 server-side protocol
Package info
github.com/nytodev/inertia-bundle
Type:symfony-bundle
pkg:composer/nytodev/inertia-bundle
v2.0.1
2026-04-05 16:24 UTC
Requires
- php: ^8.1
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
- symfony/framework-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/http-foundation: ^6.4 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
- symfony/process: ^6.4 || ^7.0 || ^8.0
- symfony/twig-bridge: ^6.4 || ^7.0 || ^8.0
- twig/twig: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.65
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10.5 || ^11.0
- symfony/browser-kit: ^6.4 || ^7.0 || ^8.0
- symfony/http-client: ^6.4 || ^7.0 || ^8.0
- symfony/twig-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/yaml: ^6.4 || ^7.0 || ^8.0
Suggests
- symfony/http-client: Required when ssr_enabled is true (SSR server communication)
This package is auto-updated.
Last update: 2026-04-05 16:38:43 UTC
README
Symfony bundle implementing the Inertia.js v2 server-side protocol — the Symfony equivalent of inertiajs/inertia-laravel.
Requirements
PHP ^8.1 · Symfony ^6.4 / ^7.4 / ^8.0 · Twig ^3.0
Installation
composer require nytodev/inertia-bundle
Without Symfony Flex, register the bundle manually in config/bundles.php:
Nytodev\InertiaBundle\InertiaBundle::class => ['all' => true],
Configuration
# config/packages/inertia.yaml inertia: root_view: base.html.twig # Root Twig template (default: base.html.twig) version: null # Asset version string — triggers full reload on change encrypt_history: false # Globally encrypt browser history state ssr_enabled: false # Enable SSR (requires symfony/http-client) ssr_url: 'http://127.0.0.1:13714' ssr_bundle: null # Path to SSR JS bundle, auto-detected if null
Basic usage
use Nytodev\InertiaBundle\Service\Inertia; #[Route('/users')] public function index(Inertia $inertia): Response { return $inertia->render('Users/Index', [ 'users' => $this->repository->findAll(), ]); }
Your root Twig template:
<!DOCTYPE html> <html> <head> {{ inertiaHead(page) }} </head> <body> {{ inertia(page) }} </body> </html>
Documentation
Full documentation is available in docs/.
License
MIT — see LICENSE.