Skip to content

Missing "NotInSub" / "InSub" in CacheKey generator types #149

Closed
@smartssa

Description

@smartssa

Describe the bug
Using a NotIn with a function call to create a subquery causes a crash. Adding "NotInSub" and "InSub" to the array in CacheKey.php#100 makes the crash go away, but it doesn't appear to invalidate the cache properly when the subquery data changes.

Eloquent Query

        return Challenge::whereNotIn('id', function ($query) use ($userId) {
                $query->select('challenges_id')->from('users_has_challenges')->where('users_id', '=', $userId);
            })
            ->orderBy('created_when', 'DESC')
            ->limit($limit)
            ->get();

Stack Trace

ErrorException(code: 0): Undefined index: operator at /Volumes/Storage/Git/triviosity-2.0-web/vendor/genealabs/laravel-model-caching/src/CacheKey.php:102

Environment

  • PHP: 7.2.5
  • OS: macOS 10.11.6
  • Laravel: 5.6.28
  • Model Caching: 0.2.63

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions