From b5d5a6fa7735882318319d24b224c4e8bc763315 Mon Sep 17 00:00:00 2001 From: Herbert Maschke Date: Tue, 16 Mar 2021 14:40:10 +0100 Subject: [PATCH] Use the part of the query (->from) instead of the table name of the model (->table) --- CHANGELOG.md | 5 +++++ src/CacheKey.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a379136..d1d4163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.10.3] - 2021-03-16 +### Changed +- The from part of the query ($query->from) instead of the table name of the model ($model->table) + is now used for determining the table part caching key fragment + ## [0.10.2] - 2020-09-04 ### Added - functionality to inject custom builder class for handling conflicting packages. diff --git a/src/CacheKey.php b/src/CacheKey.php index c85aac3..c4b985f 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -69,7 +69,7 @@ protected function getLimitClause() : string protected function getTableSlug() : string { - return (new Str)->slug($this->model->getTable()) + return (new Str)->slug($this->query->from) . ":"; }