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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners