Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kaiden's avatar

change default pagination view to default.blade.php

you know laravel uses bootstrap-4.blade.php pagination which resides in Illuminate/pagination/resources/views route as default pagination view. How to change this to its next sibling (default.blade.php)?

0 likes
5 replies
crnkovic's avatar

https://laravel.com/docs/5.6/pagination#customizing-the-pagination-view

However, the easiest way to customize the pagination views is by exporting them to your resources/views/vendor directory using the vendor:publish command:

php artisan vendor:publish --tag=laravel-pagination

This command will place the views in the resources/views/vendor/pagination directory. The bootstrap-4.blade.php file within this directory corresponds to the default pagination view. You may edit this file to modify the pagination HTML.

kaiden's avatar

@crnkovic i know this method and no id ont want it. i want it to use default.blade.php as default view. it also says

If you would like to designate a different file as the default pagination view, you may use the paginator's defaultView and defaultSimpleView methods within your >AppServiceProvider:

use Illuminate\Pagination\Paginator;

public function boot()
{
    Paginator::defaultView('pagination::view'); // i did not get what to write inside parentesis

    Paginator::defaultSimpleView('pagination::view');
}

however i couldn't understand what to write inside the parenthesis

kaiden's avatar
kaiden
OP
Best Answer
Level 1

i found it.

go to AppServiceProvider and modify boot method like this.

public function boot()
{
    Paginator::defaultView('pagination::default');
}

dont forget to add use Illuminate\Pagination\Paginator at the top of it

however i didn't get why i am doing like that.

4 likes
Negus's avatar

I still couldn't make the Paginator styling to the default.blade.php, i saw the form from years ago but still couldn't work

use Illuminate\Pagination\Paginator; use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register(): void { // }

/**
 * Bootstrap any application services.
 */
public function boot(): void
{
    // Paginator::useTailwind();
    // Paginator::defaultView('resources\views\vendor\pagination\default');
		Paginator::defaultView('pagination::default');
}

}

Please or to participate in this conversation.