Laravel Livewire Pagination Example Tutorial

Admin   Laravel   756  2021-03-15 17:00:11

Hello Friends,

In this blog, I will show you how to add simple pagination livewire in laravel application. We will show simple pagination with data in laravel livewire. I would like share with you implement pagination livewire in laravel.

If you have to need show data with pagination in livewire then you can use bellow example. In this artical, I will learn you laravel livewire simple pagination. You can add pagination in table with data in livewire laravel at that time use bellow example.

Livewire is a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.Livewire relies solely on AJAX requests to do all its server communicaton.

Here I will give full example for load more data livewire in laravel,So Lets follow the bellow step.

Step 1 : Install Laravel App

In First step, We need to get fresh laravel version application using bellow command. So Let's open terminal and run bellow command.


composer create-project --prefer-dist laravel/laravel blog

Step 2 : Setup Database Configuration

After successfully install laravel app thenafter configure databse setup. We will open ".env" file and change the database name, username and password in the env file.








Step 3 : Install Livewire

In this step, You will simply install livewire to our laravel application using bellow command:


composer require livewire/livewire

Step 4 : Create Component

Now, You can create livewire component using bellow command, So Let's run bellow command to create user component:


php artisan make:livewire users

Now they created fies on both path:




Now first file we will update as bellow for Users.php file.




namespace App\Http\Livewire;

use Livewire\Component;

use App\User;

class Users extends Component


public function render()


$users = User::latest()->paginate(5);

return view('livewire.users-list',['users' => $users]);



Step 5 : Add Route

now, we need to add route for list users in laravel application. so open your "routes/web.php" file and add following route.




Step 6 : Create View

Here, we will create blade file for show users list. in this file we will use @livewireStyles, @livewireScripts and @livewire('users'). so let's add it.




<div class="table-responsive">

<table class="table table-bordered">









@foreach($users as $user)


<td>{{ $user->id }}</td>

<td>{{ $user->name }}</td>

<td>{{ $user->email }}</td>





{{ $users->links() }}





<!DOCTYPE html>




<script src="{{ asset('js/app.js') }}" defer></script>

<link href="{{ asset('css/app.css') }}" rel="stylesheet">




<div class="container">

<div class="row justify-content-center">

<div class="col-md-8">

<div class="card">

<div class="card-header">

<h2>Laravel Livewire Simple Pagination Example -</h2>


<div class="card-body">

@if (session()->has('message'))

<div class="alert alert-success">

{{ session('message') }}












Now we are ready to run our example so run bellow command for quick run:


php artisan serve

Now you can open bellow URL on your browser:



It will help you..