Laravel Next Previous Link Button Pagination

About Us:

We are from free coder. We are a group of web developers who are passionate about web development. You can learn from us php, laravel, node js, vue js, react js and many other topic on web developement.
we are very happy to help you.
free coder

Today what you are going to learn:

Do you want to add next previous button on pagination in laravel 6?, if yes then i will help you to create simple pagination with laravel 6. we will customize pagination link with only next and previous button in laravel 6.

we can add next and previous link on pagination using simplePaginate() in laravel 6, laravel 7 and laravel 8 application. laravel provide new eloquent method simplePaginate() for adding simple pagination with only next previous button link.

If you also want to add pagination with next and previous link then follow bellow some step and make it done as like bellow screen shot:

Create Route:

In first step, we will create simple routes for getting users and view it, so let's add new route in web.php file:


Route::get('users', 'UserController@index');

Create Controller:

Now, we will create new UserController with index() method. in index() we will write simple pagination code. so let's create as like bellow:



namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\User;

class UserController extends Controller



* The attributes that are mass assignable.


* @var array


public function index()


$users = User::simplePaginate(5);

return view('users', compact('users'));



Create View File:

In this last step, we will create simple blade file and display users with pagination. so let's add bellow code:


<!DOCTYPE html>



<title>Laravel Next Previous Link Button Pagination -</title>

<link rel="stylesheet" href="">



<div class="container">

<h1>Laravel Next Previous Link Button Pagination -</h1>

<table class="table table-bordered">





@foreach($users as $user)


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

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




{{ $users->links() }}




Ok, now you have to create some dummy records on users table.

Then you can check it.

thank you very much for following up with me.

Recent Posts

Related Posts