Open saernz opened 4 years ago
@saernz Thanks for this! I will look into this over the next few days, time permitting.
@saernz Will have to work on this some more. Tried coming up with a solution today, but having a bit of trouble trying to extract the key of with with
query. WIP
Related to #291
Describe the bug When using constrained eager loading the first cached result is always return regardless of any changes to the constraint. I could not find any other issues relating to this and the docs only mentioned lazy-loaded relationships are unsupported at the moment so I thought it wise to raise this as a bug.
Eloquent Query I've provided a test that you can copy and paste into
tests/Integration/CachedBuilderRelationshipsTest.php
which should show my problem.Then when running
./vendor/bin/phpunit --filter CachedBuilderRelationshipsTest
I get the following result:Environment
Additional context Can use:
to workaround the problem for my specific query at the moment, but for some reason
->disableCache()
did not work.Thanks for the great library, has been working great so far. Wish I had more time to look into this more or do a PR but even as it is I have probably got a little too side tracked :)