-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Labels
Description
Describe the bug
Seems Like this Package doesn't work when using Spatie's Laravel query builder to fetch the data (https://github.com/spatie/laravel-query-builder). I've checked that package and they don't override newEloquentBuilder() method, so all should work.
By not working i mean no cache data is returned and the query still hits the database.
Eloquent Query
This query don't work
$student = QueryBuilder::for(Student::class)
->join('entidades', 'entidades.id', '=', 'alunos.entidade_id')
->where('entidades.user_id', $user->id)
->first();But this work:
$student = Student::join('entidades', 'entidades.id', '=', 'alunos.entidade_id')
->where('entidades.user_id', $user->id)
->first();Stack Trace
No stack trace, because no error is generated. Just no data is cached
Environment
- PHP: 7.3.6
- OS: Ubuntu 19.04
- Laravel: 5.8.29
- Model Caching: 0.6.1
- Spatie Laravel Query Builder: 1.17.5