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.
- PHP 8.4+
crustum/broadcasting
See Versions.md for the supported CakePHP versions.
For documentation, as well as tutorials, see the docs directory of this repository.
Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.