In the end, it’s not the years in your life that count. It’s the life in your years.

— Abraham Lincoln

Simple Pagination in Laravel 9

Step 1: Use paginate in controller

    public function index()
    {
        return view('user.index', [
            'users' => DB::table('users')->paginate(15)
        ]);
    }

onEachSide use to how many paginate page number show beside current page in pagination.

{{ $users->onEachSide(1)->links() }}
What’s your Reaction?
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Leave a Reply