To get started, let's review the basics of Livewire and build the obligatory counter example. Next, we'll take a brief look at the request/response lifecycle of a Livewire component.
Let's convert a vanilla contact form to use Livewire. This will give us the opportunity to also review real-time validation. This component should give you a solid understanding of the basics of Livewire, including binding data with wire:model
, calling methods on the server, and re-rendering views.
Testing Livewire components is a breeze. Let's have a look at testing our contact form and all of its features.
Next up, let's use the iTunes API to build a search dropdown that allows us to search for songs and artists. As part of this example, we'll also review how to test it.
Pagination in Livewire is quite similar to pagination within a vanilla Laravel. Let's review everything you need to know in this episode.
View the source code for this episode on GitHub.
Let's build a datatables component that allows a person to search, filter, sort and manipulate the query string. This component will demonstrate the power of Livewire, as building a datatables component the traditional way would require a significant amount of JavaScript.
Continuing from the previous episode, let's now write a series of tests for our datatable component.
In this lesson, we'll convert the comments functionality from vanilla Laravel to a Livewire component. Components like these are great use-cases for Livewire components, where we don’t want to trigger a full page-refresh after submitting a form.
Let's continue with the comments component we wrote in the previous episode, and learn how to test it.
Let's have a look at an example that uses polling in Livewire. Polling can prove useful when your components should continuously refresh to display the latest data.
Moving on, let's explore file uploading in Livewire. Livewire makes use of temporary uploads which allows us to perform real-time validation and image previews. Let's take a look at these with an example using posts with a cover image.
Now, let's learn how to test the file upload component that we wrote in the previous episode.
Let's review Livewire's event system by playing with a third-party tagging library. Livewire allows you to fire and listen for events in the front-end or the back-end, which makes component communication a cinch.
Once again, let's test our tags component, as well as the Livewire events.