My First Time with Livewire

My First Time with Livewire

I've been looking into Livewire for quite some time now, but never really had a need to use it and the way I learn best is by working on a project that I can actually "launch" at the end of it.

Well recently at work, I decided to build an internal status page for all of our internal tools and systems so that folks could visit it and find out what's going on with any of them (we have a lot).

This was a simple application and there isn't much to it, which is why I thought it was the ideal candidate for finally trying out Livewire. It's worth noting that I've also used Vue years ago but didn't really get on with it, I think it's because it's Javascript and I come from more of a PHP background, which is why I fell in love with Livewire from the get go.

As soon as I installed Livewire into my application and built a simple component, then had it render in my view, I was hooked. It is super intuitive and it just makes sense. The best bit? It's pure PHP 😍

This is a status page, so of course it would be good if you were viewing it, a status update came in and the results just updated instantly whilst you viewed the page, Livewire makes this so easy by just adding wire:poll to the div of the component that contains the results.

I like how Livewire handles pagination too, if you use the Pagination trait within your Component, then you end up with pagination that doesn't reload the entire application every time you change the page, however it still updates a query param in the URL if you wanted to share the specific page with someone, for example.

I love how Livewire handles query parameters, you can search for results live, without needing to reload the application and Livewire handles updating the URL for you. It's magic!

The status page application was really simple so I only scratched the surface with what Livewire is capable of. This was really my first delve into using the TALL stack:

  • Tailwind
  • Alpine
  • Livewire
  • Laravel

and I think it'll be the stack I use going forward. I found it incredibly easy to get an application started and finished in no time at all and I'm so glad I finally bit the bullet and tried Livewire!