Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel custom pagination view not working

I'm using Laravel 8 with Tailwind CSS. Tried customising the default pagination view as per documentation. Published the view using php artisan vendor:publish --tag=laravel-pagination, but it is still using the default, not the published view. I also tried explicitly specifying the default view for paginator as described in the documentation, by adding Paginator::defaultView('resources/views/vendor/pagination/tailwind.blade.php'); to AppServiceProvider:boot() method. That also doesn't work. Clearing caches didn't help.

like image 436
Nicolas Avatar asked Oct 14 '25 14:10

Nicolas


1 Answers

Turns out because I was using Livewire component for rendering the page, had to use php artisan livewire:publish --pagination instead. Which publishes the exact same file, but into livewire instead of pagination subdirectory. Which is super confusing IMHO and should be mentioned in the documentation.

like image 124
Nicolas Avatar answered Oct 17 '25 05:10

Nicolas