Skip to content

Soft delete #237

@tmishutin

Description

@tmishutin

Describe the bug
It seems like there is an issue with soft delete. If model using soft delete and result of NOT deleted query is cached, library will ignore global scoping of soft delete scope for the model which will result in wrong return.

Eloquent Query
The following will not find a deleted item

Book::withTrashed()->find($id)

However the following WILL find the deleted item

Book::whereNotNull('deleted_at')->find($id)

Stack Trace

Environment

  • PHP:7.2
  • OS: Debian stretch
  • Laravel: 5.8
  • Model Caching: 0.4.11

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions