Source: kornatzky.medium.com

Infinite Scroll with Livewire
Building a web site for an auction, we wanted an infinite scroll of lots as many lots where expected. The web application is a Laravel project with Livewire for the views. The list of lots is a Livewire component: $count tracks the number of lots to show on the screen. We render the view with: Using the computed property, So we take $count items. We use Tailwind to construct the view, Listen on the window scroll event, The Livewire component has a listener for the loadMore event, The listener u pdates the count of lots to be shown, thereby causing a rendering of the view with more ad infinitum.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners