r/cakephp • u/josbeir • 5d ago
CakePHP Interact: reactive interfaces with PHP and Alpine
Hey everyone! I’ve been working on CakePHP Interact, a reactive UI framework for CakePHP: https://www.cakeinteract.dev/
It’s along similar lines to Laravel Livewire and Symfony UX Live Components. I like the simplicity of rendering HTML in PHP, and I wanted to keep that workflow while building more interactive interfaces.
I’ve really enjoyed working with Alpine + htmx. With Interact, I wanted something more integrated. It uses Alpine in the browser and native fetch for requests, with no dependency on htmx, Livewire, or any other reactive UI framework.
You define state and actions in PHP, and Interact handles the requests, action endpoints, synchronization, and DOM updates. Less time coordinating the interaction lifecycle, more time working on the actual application.
You can add it to an existing CakePHP app that uses regular templates, starting with a search field or an interactive form, or take it all the way to a PHP-managed SPA.
Rendering stays in CakePHP templates, and your application controls authorization, validation, and saving. It also supports streaming text, HTML, and progress during actions, plus realtime subscriptions for updates from other users or background jobs.
Curious to hear what other CakePHP developers think.