Is it possible to use livewire without Laravel

Viewed 486

everyone in here, I am not really into PHP frameworks, but luckily yesterday I and a friend were making a review of different PHP frameworks and we came to an encounter with one of the concepts used by Laravel, Livewire, I did a study about it for a bit and it was really impressive, so far I could say it is something like ajax but on a next level though it could be something more.

I was wondering if I could use it with core PHP, any suggestions would be great.

4 Answers

Laravel Livewire is specifically made for Laravel. But Livewire uses Alpine JS framework to get the JavaScript behavior into it. Because of this the front end integration in these two look very similar. Read it here https://laravel-livewire.com/docs/2.x/alpine-js

If its a simple dropdown that doesn’t need at model binding i use Alpine JS alone. If have to do anything with data from backend i use Livewire. You can use AlpineJS anywhere like you use jQuery. Alpine js is very lightweight standalone JS framework.

Thank you everyone, for your beautiful answers and explanations, after a time of research and playing with different tools I have found the right alternative to the laravel-livewire which I can use outside laravel, HTMX

It is a library that allows one to access modern browser features directly from HTML, rather than using javascript.

No, Livewire is Laravel's full-stack framework, does not work stand alone as of Livewire official introduction:

Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.

Related