Hello to all, welcome to therichpost.com. In this post, I will tell you, Customize Laravel Database Query Pagination with Bootstrap Style.
This is the new thing I have learnt today and I am going to share with you guys and I am very happy during share this code. Laravel is the best Php MVC framework because of many reasons and this post has one of the major reason.
Here is the working picture:
I am just sharing the simple code snippet with bootstrap cdn file and you can adjust according your requirements.
Laravel provides us so many good features the laravel database query default paginate is the very good feature and I just love that.
DB::table('user')->paginate(15);
Now here is the working and tested code for Customize Laravel Database Query Pagination with Bootstrap Style and you can add this any laravel blade template file:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <h1>Users:</h1> <ul class="list-group"> @php $users = DB::table('user')->paginate(15); foreach($users as $user) { echo '<li class="list-group-item">'.$user->firstName.'</li>'; } @endphp </ul> @php echo $users; @endphp
This is it. If you have any query related to this post then please do comment below or ask question.
Thank you,
Jatt,
TheRichPost.
Recent Comments