Eloïse's avatar

Pagination styling does not work

Hello,

I'm trying to use the tailwind pagination, I've got published the vendors assets with the command

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

then I've added the links in my blade view like this

{{ $sessions->links('pagination::tailwind') }}

But unfortunately all I got is unstyled previous and next buttons... It seems that "pagination:tailwind" has nos effect despite the links are working. Thanks for your help.

0 likes
7 replies
Nakov's avatar

You can instead try to register the paginator to use tailiwind.

So in your AppServiceProvider in the boot method add this:

Paginator::useTailwind();

the import at the top should be use Illuminate\Pagination\Paginator;

and then just use links() no need to pass the view.

Eloïse's avatar

@Nakov Thanks for your answer, but unfortunately it doesn't work the links style doesn't change

Nakov's avatar
Nakov
Best Answer
Level 73

@Eloïse make sure you run npm run production again in case those classes are not built.

1 like
Eloïse's avatar

@Nakov Ah yes, thanks, my bad ! ;) last question, I don't understand why there is only prev and next buttons and not 1 2 3 links ?

Nakov's avatar

@Eloïse you use pagination or simplePagination? you will have to show more code for a better answer.. the initial question was answered anyway 🙂

Eloïse's avatar

@Nakov Yes you deserves the best answer. I used pagination, not simplePagination accordingly to the documentation. My test data counts 3 items and I used paginate(1)

Please or to participate in this conversation.