Monday, November 30, 2020
therichposts@gmail.com
BootstrapBootstrap 4LaravelLaravl 5.7

Customize Laravel Database Query Pagination with Bootstrap Style

Laravel 7.2 routing with route group auth guard check with prefix

Customize Laravel Database Query Pagination with Bootstrap Style

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:

Customize Laravel Database Query Pagination with Bootstrap Style

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.

 

 

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, Angular 8, Angular 9, Angular 10, Angular 11, Nodejs, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.