Skip to content

whereRaw is cached regardless of the arguments #244

Closed
@jf-m

Description

@jf-m

Describe the bug
The following bug #111 seems to have exactly reappeared.

Eloquent Query

SomeModel::whereRaw('somecolumn = ?', ['somevalue'])->get();
SomeModel::whereRaw('somecolumn = ?', ['anothervalue'])->get();
SomeModel::whereRaw('somecolumn = ?', ['yetanothervalue'])->get();

The second and third query always returns the result of the first query.

Environment

  • PHP: 7.3.3
  • OS: MacOs Mojave
  • Laravel: 5.8
  • Model Caching: 0.4.16

Workaround
For the record, the following workaround is not ideal but works well :

SomeModel::whereRaw("somecolumn = '" . $somevalue . "'");
SomeModel::whereRaw("somecolumn = '" . $anotherValue . "'");
SomeModel::whereRaw("somecolumn = '" . $yetanothervalue . "'");

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions