BootstrapBootstrap 4LaravelLaravl 5.7

Customize Laravel Database Query Pagination with Bootstrap Style

Customize Laravel Database Query Pagination with Bootstrap Style

Laravel
119Views

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 full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

Positive SSL