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

Stale cached value returned where(...)->first() #453

Open
Assignees
Labels
@aaroncameron

Description

Describe the bug
Requesting the first (and unique) result with Model::where(...)->first() returns an old, incorrect result,

Eloquent Query

MyModel::where(['a'=>1,'b'=>2])->first(); // returns an old result
MyModel::where(['a'=>1,'b'=>2])->get()->first(); // returns the correct result.

Environment

  • PHP: 8.1.2
  • OS: Ubuntu 22.04
  • Laravel: 10.15.0
  • Model Caching: 0.13.4

Additional context
That the result in my test case is unique may or may not be relevant. Have not constructed a test where it is not to confirm.

There is in the above a unique key across a,b. The result is not simply coincidentally unique, but is by definition.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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