crustum / inertia-cakephp
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
Requires
- php: >=8.4
- cakephp/cakephp: ^5.4
- crustum/broadcasting: ^1.3
Requires (Dev)
- cakedc/cakephp-phpstan: ^4.3
- cakephp/cakephp-codesniffer: ^5.3
- crustum/plugin-manifest: ^1.2
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^11.1 || ^12.5 || ^13.0
- rector/rector: ^2.7
Suggests
- crustum/plugin-manifest: CakePHP plugin installer
Provides
None
Conflicts
None
Replaces
None
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.