2

I want to use pagination for my page, so I added this at the Controller:

$suspendeds = Order::where('status', 'awaiting')->latest()->paginate(1); return view('profile.index', compact('suspendeds'));

And on the Blade:

{{ $suspendeds->links() }}

But it looks like this somehow:

enter image description here

So my question is, how can I properly load this pagination? Do I need to do change the CSS styles or this is due to Laravel stuff? If this issue can be solved within CSS, what are the name of classes?

halfer
  • 19,824
  • 17
  • 99
  • 186

3 Answers3

4

Check this https://laravel.com/docs/8.x/pagination#using-bootstrap

use Illuminate\Pagination\Paginator;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    Paginator::useBootstrap();
}
Davit Zeynalyan
  • 8,418
  • 5
  • 30
  • 55
1

Put render() at the end of where your content ends in view:

<section class="content">
   <div class="row">

   </div>
   {!! $suspendeds->render() !!}    
</section>
ParisaN
  • 1,816
  • 2
  • 23
  • 55
0

From laravel 8.x doc Customizing The Pagination View By default, the views rendered to display the pagination links are compatible with the Tailwind CSS framework. However, if you are not using Tailwind, you are free to define your own views to render these links. When calling the links method on a paginator instance, you may pass the view name as the first argument to the method:

Try

 {!! $suspendeds->links('pagination::bootstrap-4') !!}

if you are using bootstrap 4 or

{!! $suspendeds->links('pagination::bootstrap-5') !!}

for bootstrap 5

Sirjiskit
  • 431
  • 5
  • 16