Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Laravel Livewire fails to update a component with Model Caching Enabled #493

aj-norman started this conversation in General
Discussion options

Describe the bug
Laravel Livewire fails to return the next/previous page of a paginated list while Model Caching is enabled. Turning model caching off or using disableModelCaching() on the query restores normal functionality

Eloquent Query
Please provide the complete eloquent query that caused the bug, for example:

$blogs= Blog::where('user_id', '=', Auth::id())
 ->orderByDesc('date')
 ->paginate(10);

Stack Trace
No error is given by the application

Environment

  • PHP: 7.4
  • OS: Ubuntu 20.04
  • Laravel: 8.9
  • Livewire: 2.2.9
  • Model Caching: 0.11.0

Additional context
Add any other context about the problem here.

You must be logged in to vote

Replies: 6 comments

Comment options

Hi @ajnorman-dev, would you be able to submit a failing unit test for this?

You must be logged in to vote
0 replies
Comment options

Hi @mikebronner, unfortunately I don't have a unit test set up any livewire component up yet. I can see that the ajax request is sent off for the second page of blogs, however the html payload returned is null.

You must be logged in to vote
0 replies
Comment options

please find a solution for Laravel Livewire pagination cache fix.

You must be logged in to vote
0 replies
Comment options

Same Issue here with Livewire Pagination and the package:

livewire/livewire v2.3.6
genealabs/laravel-model-caching 0.11.1 
laravel/framework v8.22.0
You must be logged in to vote
0 replies
Comment options

@jihadismail8 Thanks for following up on this. Unfortunately I can't promise any timeline for this, as this isn't on my radar for now. I would love to review and merge a PR that addresses this, though.

You must be logged in to vote
0 replies
Comment options

Same Issue here :/
Any updates on this please ?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Converted from issue

This discussion was converted from issue #377 on March 05, 2025 13:51.

AltStyle によって変換されたページ (->オリジナル) /