PHPackages                             jh3ady/inertia-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jh3ady/inertia-bundle

ActiveSymfony-bundle[API Development](/categories/api)

jh3ady/inertia-bundle
=====================

Inertia.js v3 server-side adapter for Symfony.

00PHPCI passing

Since Jun 26Pushed todayCompare

[ Source](https://github.com/jh3ady/inertia-bundle)[ Packagist](https://packagist.org/packages/jh3ady/inertia-bundle)[ RSS](/packages/jh3ady-inertia-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Inertia bundle for Symfony
==========================

[](#inertia-bundle-for-symfony)

A small, server-side adapter for the [Inertia.js](https://inertiajs.com) **v3**protocol. It lets your Symfony controllers return Inertia responses (a page component plus props) instead of Twig templates, while your frontend stays a single-page app built with React, Vue or Svelte.

It is deliberately minimal and **bundler-agnostic**: it does not bundle Vite, Webpack Encore or AssetMapper. You bring your own asset pipeline; this bundle only handles the protocol and a single Twig helper.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 6.4, 7.x or 8.x
- Twig

Installation
------------

[](#installation)

```
composer require jh3ady/inertia-bundle
```

If you do not use Symfony Flex, enable the bundle manually:

```
// config/bundles.php
return [
    // ...
    Jh3ady\InertiaBundle\InertiaBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

All keys are optional and shown with their defaults:

```
# config/packages/inertia.yaml
inertia:
    root_view: 'app.html.twig'   # template rendered on the initial load
    root_id: 'app'               # mount element id; must match createInertiaApp({ id })
    version: ~                   # asset version used to invalidate stale visits
```

Usage
-----

[](#usage)

### Controller

[](#controller)

Inject the `Inertia` service and return `render(component, props)`:

```
use Jh3ady\InertiaBundle\Inertia;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

final class DashboardController
{
    public function __construct(private readonly Inertia $inertia)
    {
    }

    #[Route('/', name: 'dashboard')]
    public function index(): Response
    {
        return $this->inertia->render('Dashboard', [
            'message' => 'Hello from Symfony',
        ]);
    }
}
```

### Root template

[](#root-template)

Drop `{{ inertia() }}` into your root template. It emits the mount element and the page object as a JSON script tag, exactly the way the Inertia v3 client reads it. The output is safe by design: the page is hex-escaped so a prop value can never break out of the script tag, so you never write `|raw` yourself.

```
{# templates/app.html.twig #}

        {# load your JS/CSS with your own bundler (Vite, Encore, AssetMapper) #}

        {{ inertia() }}

```

Pass an id to override the configured `root_id` for a specific template: `{{ inertia('root') }}`.

### Frontend

[](#frontend)

Set up the Inertia client for your framework as described in the [official documentation](https://inertiajs.com/client-side-setup). The `id`passed to `createInertiaApp` must match the bundle's `root_id`.

Shared props
------------

[](#shared-props)

Props that every page should receive (the authenticated user, flash messages, the locale) can be shared once, typically from an event listener:

```
$this->inertia->share('locale', $request->getLocale());
```

License
-------

[](#license)

[MIT](LICENSE) © Jean-Denis VIDOT

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/141402?v=4)[Eugene](/maintainers/jdevelop)[@jdevelop](https://github.com/jdevelop)

---

Top Contributors

[![jh3ady](https://avatars.githubusercontent.com/u/5817251?v=4)](https://github.com/jh3ady "jh3ady (1 commits)")

### Embed Badge

![Health badge](/badges/jh3ady-inertia-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/jh3ady-inertia-bundle/health.svg)](https://phpackages.com/packages/jh3ady-inertia-bundle)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)[pixelant/pxa-social-feed

Add Facebook, Instagram, and Twitter feeds to your site.

2349.3k](/packages/pixelant-pxa-social-feed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
