Mahmoud Al-HabashOpen to new projects
  • WorkWork
  • ServicesServices
  • LabLab
  • WritingWriting
  • ContactContact
Amman--:--عربي
Writing/Livewire

Livewire v4 Pagination: Simple and Cursor-Based

Implement efficient pagination in your components.

1 February 20261 min readLivewireاقرأ بالعربية

On this page

  1. Simple Pagination
  2. Template

Livewire v4 provides seamless pagination.

Simple Pagination

php
use Livewire\WithPagination;

class PostList extends Component
{
    use WithPagination;
    
    public function render()
    {
        return view('posts', ['posts' => Post::paginate(10)]);
    }
}

Template

blade
<div>
    @foreach($posts as $post)
        <div>{{ $post->title }}</div>
    @endforeach
    {{ $posts->links() }}
</div>
All articles

Keep reading

  • Authorization in Livewire v4 Components1 February 20261 min read
  • Blaze Pre-Compiler: Massive Performance Gains in Livewire v41 February 20261 min read
  • Building a Bookmark Feature with Livewire v41 February 20261 min read