alexvolley's avatar

Livewire pagination stops working after a couple requests

Has anyone experienced this?

I'm not really sure what to show here, so here are the pagination links

{{ $stores->appends(request()->query())->links() }}

and then I am using this in the render method

$stores = Programme::orderBy('store_id', 'ASC')
            ->paginate(8);

        return view('livewire.dashboard.main-table', compact('stores'));

And every single time if a user selects few more than a handful of pages then it will just stop making requests.

Anybody have any suggestions?

0 likes
1 reply
alexvolley's avatar

I found the solution to this, so anyone else that comes across this is aware you need to use wire:key on the foreach tr as shown below


@foreach($stores as $store)
    <tr wire:key="{{ $store->id }}">
        <td>{{ $store->name }}</td>                                  
     </tr>
@endforeach

Please or to participate in this conversation.