From db0675ba0c16abd66b0d601da2c01b96b638fe45 Mon Sep 17 00:00:00 2001 From: Muhammad Rheza Alfin Date: Tue, 28 Feb 2023 14:27:41 +0700 Subject: [PATCH 1/4] add expressionToString to getColumnClauses --- src/CacheKey.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index 0868550..faace06 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -80,7 +80,10 @@ protected function getColumnClauses(array $where) : string if ($where["type"] !== "Column") { return ""; } - + if ($where["first"] instanceof Expression) { + $where["first"] = $this->expressionToString($where["first"]); + } + return "-{$where["boolean"]}_{$where["first"]}_{$where["operator"]}_{$where["second"]}"; } From 94956a1200acfcbbf406f728464f595143a24c2d Mon Sep 17 00:00:00 2001 From: Muhammad Rheza Alfin Date: Wed, 1 Mar 2023 15:10:44 +0700 Subject: [PATCH 2/4] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0460718..35db72b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "genealabs/laravel-model-caching", + "name": "vheins/laravel-model-caching", "description": "Automatic caching for Eloquent models.", "license": "MIT", "authors": [ From a0d18a4cf87ea3f9d19e5a993504500e5eac9524 Mon Sep 17 00:00:00 2001 From: Muhammad Rheza Alfin Date: Sat, 4 Mar 2023 10:58:02 +0700 Subject: [PATCH 3/4] put back composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 35db72b..0460718 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "vheins/laravel-model-caching", + "name": "genealabs/laravel-model-caching", "description": "Automatic caching for Eloquent models.", "license": "MIT", "authors": [ From b54f6f0fd3bceb6d3155dce95aa36c268ea8f451 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Mon, 6 Mar 2023 07:42:50 -0700 Subject: [PATCH 4/4] Fixed code formatting. --- src/CacheKey.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CacheKey.php b/src/CacheKey.php index faace06..b964425 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -80,6 +80,7 @@ protected function getColumnClauses(array $where) : string if ($where["type"] !== "Column") { return ""; } + if ($where["first"] instanceof Expression) { $where["first"] = $this->expressionToString($where["first"]); }