Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Laravel LiveWire + Alpine.js can do 80% of SPA needs from your PHP backend code.

https://laravel-livewire.com/



I've been enjoying using both of these a lot.

Alpine has replaced situations where I would previously use vanilla JS or jQuery (i.e. simple UI interactivity, but Vue would be overkill), but is far nicer to use.

LiveWire is perfect for things like data tables—it's not really interactive per se, but a full page refresh to change filtering or sorting sucks, and implementing it as a purely JavaScript component makes it harder to use all the cool Laravel stuff I have on the backend. With LiveWire I can just pass in the path to a Blade partial to use as the table row template, and use all the back-end stuff I like.

That just leaves the complex, high interactivity stuff, which I continue to use Vue for.

LiveWire is missing a couple of features that's stopping me using it in production (namely the ability to apply different middleware to different components), but V2 is out soon so hopefully that will include it. If not I'll probably look at contributing it myself.


This is neat. I have been meaning to give PHP another look just to see how they've gotten along over the last half decade.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: