Lordbedwetter's avatar

Links not Working with Livewire Pagination

HI there, I am currently working on a "simple" pagination feature for blog posts.

My problem: the correct amount of posts and pagination links appear (and according to how many records are in the database), but do not navigate/change the data on the page when clicked.

Here's what I've done:

  • Made sure there is only one root div on the livewire component.
  • Made sure the {{ $posts->links() }} is outside of the foreach loop.
  • Imported the Blog model into the Component class.
  • Made sure to use the WithPagination trait

I am a bit out of ideas. I have to leave for work now. I hope someone can help point me in the right direction so I can finish this "simple" feature when I get home.

0 likes
1 reply
Lordbedwetter's avatar

I figured this out literally as I was about to walk out the door.

I am still getting used to using components and as a result, I accidently set my layout file up kind of goofy and ended up leaving out livewireScripts and livewireStyles on a page I did not extend my layout file to yet. Its amazing how easy it is to overlook something simple

Please or to participate in this conversation.