Bootstrap 4 pagination for laravel

Laravel 5.x bootstrap 4 pagination

How to switch on bootstrrap 4 pagination for laravel application

To swith on bootstrap-4 pagination instead boostrap-3 pagination for laravel 5.4 or higher we heed to add only one string to AppServiceProvider -  AbstractPaginator::$defaultView = 'pagination::bootstrap-4';

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Pagination\AbstractPaginator;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
AbstractPaginator::$defaultView = 'pagination::bootstrap-4';
}
}

 


Добавить комментарий