New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

php-forge/inertia

Framework-agnostic PHP core for the Inertia.js protocol.
7,114 2

Larablocks Analysis

php-forge/inertia works with any PHP project: the latest release (0.5.1, Sep 26, 2026) doesn't depend on Laravel.

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 1 of 3 checks; below the bar for Recommended on use.

  • Released in the last 12 months (Sep 26, 2026)
  • 1,041 downloads a month (needs 10,000)
  • 2 GitHub stars (needs 100)

State

Actively maintained
  • Last stable release: Sep 26, 2026.
  • 7 releases in the last 12 months.
  • First released: Aug 24, 2026.
  • Monthly downloads: 1,041.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.

Install
composer require php-forge/inertia
Latest Version:0.5.1
PHP:>=8.3
License:BSD-3-Clause
Last Updated:Nov 20, 2026
Links: GitHub  ·  Packagist
Maintainer: terabytesoftw

PHP Forge

Inertia


PHPUnit Mutation Testing Easy Coding Standard Dependency Check

A framework-agnostic PHP core for negotiating and producing current Inertia.js protocol data.

Features

Feature overview

Installation

composer require php-forge/inertia:^0.5

PHP 8.3 or later and the JSON extension are required.

Quick start

use PHPForge\Inertia\{PageInput, Protocol, RequestContext};
use PHPForge\Inertia\Prop\Prop;

$request = new RequestContext(
    method: 'GET',
    url: '/users?page=1',
    absoluteUrl: 'https://example.com/users?page=1',
    headers: [
        'X-Inertia' => 'true',
        'X-Inertia-Version' => 'assets-v1',
    ],
);

$input = PageInput::create(
    component: 'Users/Index',
    props: [
        'users' => Prop::merge(fn (): array => loadUsers())->append('data', 'id'),
        'analytics' => Prop::defer(fn (): array => loadAnalytics(), group: 'analytics'),
        'filters' => Prop::optional(fn (): array => availableFilters()),
    ],
    version: 'assets-v1',
)
->withSharedProps(
    [
        'auth' => Prop::once(fn (): array => currentUser())->as('authenticated-user'),
    ],
)
->withErrors(validationErrors())
->withFlash(flashedData());

$result = Protocol::create()->page($request, $input);

Protocol does not return a framework response. An adapter inspects the result, applies statusCode() and headers(), serializes page() for an Inertia visit, or embeds the page JSON in the root HTML document for an initial visit.

Resolved-page observation

The existing ResolvedPageObserver callback remains available to older adapters. New diagnostic integrations use Event/ProtocolResultCreated through the optional PSR-14 dispatcher instead; see debugging. Do not wire both paths to the same diagnostic collector.

Adapter boundary

The core owns protocol decisions and page shaping. A framework adapter remains responsible for:

  • extracting the method, relative URL, absolute URL, and supported request headers;
  • resolving shared props, validation errors, flash data, and the asset version;
  • rendering the root HTML document and embedding the initial page JSON;
  • translating neutral results into its HTTP response implementation;
  • managing sessions, flash persistence or reflashing, redirects, routes, CSRF, and asset tooling;
  • JSON encoding the final page with the framework application's selected flags.

See the configuration reference for the complete result mapping.

Debugger integration

Protocol emits ProtocolResultCreated through an optional PSR-14 dispatcher. The protocol core never imports a debug contract or calls a collector, so installing the package does not activate a debugger and a call without a dispatcher emits no events. The collector and panel that do implement those contracts live apart, in PHPForge\Inertia\Debug, owned by this package.

See Debugger integration for the Yii2 and Yii3 wiring. It remains an unreleased prototype.

Yii2 Inertia panel in Yii2
Yii3 Inertia panel in Yii3

Documentation

Package information

PHP Latest Stable Version Total Downloads

Code quality

Codecov PHPStan Level Max Quality StyleCI

Social networks

Follow on X

License

License

Related Packages

lastdragon-ru/lara-asp-spa

Provides various SPA Helpers.

7,946 0
amicrud/search

Search for a method, class, or variable in the project using artisan command

279 1
php-flasher/flasher

The foundational PHP library for PHPFlasher, enabling the creation of framework-...

5,035,140 64
imsus/laravel-inertia-vue-starter-kit

A Laravel starter kit with Inertia.js, Vue 3, and Vite+.

3 1
valorin/random

Random is a simple helper package designed to make it easy to generate a range o...

479,812 234
php

Version History

Version Released PHP License
0.5.1 >=8.3 BSD-3-Clause
0.5.0 >=8.3 BSD-3-Clause
0.4.0 >=8.3 BSD-3-Clause
0.3.0 >=8.3 BSD-3-Clause
0.2.1 >=8.3 BSD-3-Clause