-
Notifications
You must be signed in to change notification settings - Fork 225
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Doesn't work with Spatie's Laravel QueryBuilder #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@backstageel Thanks for submitting your issue. This package will not work with third-party query builders, only with Laravel's query builder. Sorry. |
Actually, i got this Working... It was as simple as creating a custom builder class that extends Spatie's QueryBuilder and apply the traits from this package on it: namespace App\Builders;
use GeneaLabs\LaravelModelCaching\Traits\Buildable;
use GeneaLabs\LaravelModelCaching\Traits\BuilderCaching;
use GeneaLabs\LaravelModelCaching\Traits\Caching;
use Spatie\QueryBuilder\QueryBuilder;
class CustomBuilder extends QueryBuilder
{
use Buildable;
use BuilderCaching;
use Caching;
} |
I'll add this to the documentation, thanks! |
@mikebronner This doesn't seem to be added to the documentation? :) @backstageel Does it still work for you? |
I think I removed it again, because I started work on developing an internal solution that wouldn't require more work. Unfortunately I have not been able to complete that at this time due to life circumstances changing A LOT this year. |
"a custom builder class" not work for me
|
any update? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
But this work:
Stack Trace
No stack trace, because no error is generated. Just no data is cached
Environment
The text was updated successfully, but these errors were encountered: