You're experiencing a common Livewire 3 issue where pagination links are rendered, but clicking them doesn't trigger updates. This usually indicates that Livewire is not properly mounting or recognizing your component on the page. Here's a checklist and fix strategy to solve the issue:
Component is not mounted using Livewire directives (<livewire:...>
or @livewire(...)
)
Missing wire: key
on root elements in a paginated or dynamic context
Pagination links using custom Blade view are missing Livewire directives
Livewire script not running properly on page load (often with Jetstream + Livewire stack)
Missing or incorrect Alpine.js + Livewire script setup
In your Blade view (resources/views/admin/categories.blade.php
or wherever this component is used), the component should be included like this:
blade
CopyEdit
<livewire: admin.category-management />
Please don't render it with @include()
or blade logic.
Since you're using:
php
CopyEdit
#[Layout('layouts.admin')]
Make sure layouts/admin.blade.php
includes both:
blade
CopyEdit
@livewireStyles ... @livewireScripts @stack('modals') {{-- If using Jetstream --}}
And Livewire's JS is after Alpine if you're using Alpine.js:
blade
CopyEdit
<script src="//unpkg.com/alpinejs" defer></script> @livewireScripts
wire: click
CarefullyYour custom pagination component looks mostly correct, but you must add:
wire:click="gotoPage({{ $page }})"
on page links
type="button"
on all interactive elements
Here’s an improved example of a page button:
blade
CopyEdit
<button type="button" wire:click="gotoPage({{ $page }})" wire:loading.attr="disabled" class="btn btn-outline mx-1"> {{ $page }} </button>
Make sure you do not use regular anchor <a>
tags with href
, or the full page will reload.
Add this to your component:
php
CopyEdit
protected$queryString = ['page'];
This helps Livewire track pagination state properly, especially with Jetstream.
Temporarily add this to the render()
method to confirm the component is mounted:
php
CopyEdit
publicfunction mount() { logger('CategoryManagement mounted'); }
Check the Laravel log. If it doesn’t show, Livewire is not mounting your component correctly.
To rule out your custom view as the problem, try switching temporarily to:
blade
CopyEdit
{{ $cat->links() }}
If this works, your custom pagination view likely has broken or missing Livewire directives.
Confirm you're rendering with <livewire:admin.category-management />
Add protected $queryString = ['page'];
to component
Verify @livewireScripts
is included after Alpine
Test using default pagination to isolate view issue
Update pagination buttons to use wire:click="gotoPage(...)"
If you've checked all of these and it's still not working, let me know and we can try an isolated reproduction or dive into Jetstream/Livewire Livewire hydration quirks.