mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.26k stars 217 forks source link

Fix incorrect cache key in multiple DB connection. #213

Closed PokeGuys closed 5 years ago

PokeGuys commented 5 years ago

This PR fixed a makeCacheKey bug mentioned in Issue #212. It used default DB connection to make query instead of using $connection in model.

mikebronner commented 5 years ago

Thanks @PokeGuys ! I will take a look at this as soon as I can. :)

PokeGuys commented 5 years ago

This will cause another issue. The eager load relation will be used the caller connection, not their own connection name.

mikebronner commented 5 years ago

@PokeGuys thanks for the heads up, I'm close to wrapping up the L5.8 update, and will look at these next.

mikebronner commented 5 years ago

@PokeGuys Thanks for your patience, and bringing this issue up! This will be in the next release. I didn't merge, because there was a bunch of other work that needed to be done to allow model relationships to cache correctly across different connections and databases.