r/cakephp • • 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.

9 Upvotes

3 comments sorted by

4

u/Snoo65160 5d ago

This is great. I've been wanting this exact functionality in Cake ever since Livewire launched on Laravel. Nice work.

3

u/sirsavant 5d ago

This is pretty neat, and I think the exact way a framework should integrate this sort of dynamic interactivity into applications. Not everyone needs a full-blown React/Vue application, and this really helps bring an element of delight to what might otherwise be a boring internal admin panel.

2

u/woxfly 3d ago

Excellent work! Thank you for your contribution to the CakePHP ecosystem. It's always great to see innovative projects like this helping the framework move forward. Keep up the great work!