Search by

crustum / inertia-cakephp

skiedr

CakePHP Inertia.js adapter: Inertia pages, shared and partial props, validation with Precognition, SSR, and DevTools

Package info

github.com/Crustum/inertia-cakephp

Type:cakephp-plugin

pkg:composer/crustum/inertia-cakephp

Statistics

Installs: 53

Dependents: 4

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-11-18 02:52 UTC

This package is not auto-updated.

Last update: 2026-11-19 00:57:05 UTC


README

The InertiaCakephp plugin is the Inertia.js server-side adapter for CakePHP applications. Controllers, routing, middleware, authentication, and data fetching stay server-side; the view layer is replaced with JavaScript page components, with no separate API layer.

The plugin builds Inertia page objects (component, props, url, version) and returns them as JSON for Inertia visits or as HTML on the first visit. It handles shared props (errors, auth, csrfToken), partial reloads, deferred/merge/scroll/once/live props, asset-version 409 conflicts, redirects with 303 conversion and 409 location/fragment control responses, and flash data including CakePHP FlashComponent messages.

Validation runs through sharable request objects with a validating controller factory, plus a Precognition short-circuit for live per-field validation, alongside FormProtection tokens, server-side rendering through an HTTP gateway, exception rendering as Inertia error pages, and DevTools recording with a DebugKit panel.

Requirements

  • PHP 8.4+
  • crustum/broadcasting

See Versions.md for the supported CakePHP versions.

Documentation

For documentation, as well as tutorials, see the docs directory of this repository.

License

Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.