Search by

creativspeed / inertia-bundle

CreativSpeed

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

Statistics

Installs: 161

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0 2026-09-04 20:46 UTC

This package is auto-updated.

Last update: 2026-09-04 21:03:32 UTC


README

Latest Stable Version Total Downloads License

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