From f9d637a18b4777e50a087c5359a95f914fefd0eb Mon Sep 17 00:00:00 2001 From: Dan-Radu Pana Date: Tue, 16 Apr 2024 16:18:02 +0300 Subject: [PATCH 1/2] Fixes `query` attribute not existing under strict mode --- src/Traits/ModelCaching.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Traits/ModelCaching.php b/src/Traits/ModelCaching.php index 1f428c3..3171529 100644 --- a/src/Traits/ModelCaching.php +++ b/src/Traits/ModelCaching.php @@ -22,6 +22,11 @@ public function __get($key) ?? 0; } + if ($key === 'query') { + return $this->query + ?? $this->newModelQuery(); + } + return parent::__get($key); } From 874bbb58406d78c420e18f393dbf3a90a3fff244 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Feb 2025 16:03:30 -0700 Subject: [PATCH 2/2] Update ModelCaching.php Signed-off-by: Mike Bronner --- src/Traits/ModelCaching.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/ModelCaching.php b/src/Traits/ModelCaching.php index 3171529..b986af0 100644 --- a/src/Traits/ModelCaching.php +++ b/src/Traits/ModelCaching.php @@ -22,7 +22,7 @@ public function __get($key) ?? 0; } - if ($key === 'query') { + if ($key === "query") { return $this->query ?? $this->newModelQuery(); }