Categories

Sunday, December 22, 2024
#919814419350 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.

 

 

therichpost
the authortherichpost
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 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

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