Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"exclude-tables" configuration not working and throwing error #122

Open
abishekrsrikaanth opened this issue Sep 6, 2023 · 1 comment
Open

Comments

@abishekrsrikaanth
Copy link

abishekrsrikaanth commented Sep 6, 2023

I am using Spatie's MediaLibrary and when I reference the trait to cache a Model that uses the HasMedia Interface and InteractsWithMedia trait, any queries to that model fails to work. This is because the LadaCacheTrait is not used on the MediaLibrary package referenced above. To go around this, if I understand correctly, there is a configuration on the config file to exclude the table. So I update the config to the following

 'exclude-tables' => [
        (new \Spatie\MediaLibrary\MediaCollections\Models\Media())->getTable()
    ],

this doesn't seem to have any effect and the error persists. My understanding from what I see on the readme is that this package should ignore queries that are excluded in the above config.

Error Message

Spiritix\LadaCache\QueryHandler::setBuilder(): Argument #1 ($builder) must be of type Spiritix\LadaCache\Database\QueryBuilder, Illuminate\Database\Query\Builder given

Any reason why this config isn't working?

Version Information

Laravel: v10.22.0
PHP: v8.2
Lada-Cache: Version: v5.3

@spiritix
Copy link
Owner

That's a known issue with thirdparty packages, see here for a possible solution: #99 (comment)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants