Bootstrap 5 Pagination Views Laravel

Updated at 22-Aug-2022, By samar

Bootstrap 5 Pagination Views Laravel

Through many examples, we will learn how to resolve the "Bootstrap 5 Pagination Views Laravel".

You can use bootstrap 5 pagination in Laravel application using `Paginator::useBootstrapFive();` code snippet in boot method of AppServiceProvider class in `app\Providers\AppServiceProvider.php` file.
  • app\Providers\AppServiceProvider.php

    use Illuminate\Pagination\Paginator;
     
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Paginator::useBootstrapFive();
    }
    

    Display pagination in Laravel 9

    app\Http\Controllers\<OrderController>.php

    $orders = Order::search('Star Trek')->paginate(15);
    return view('home', compact('orders'));
    

    resources\views\home.blade.php

    {{ $orders->links() }}
    

Back to code snippet queries related laravel