From 8ec65c330d550023448e1cfd41c517e082a64e09 Mon Sep 17 00:00:00 2001 From: Tofandel Date: Wed, 11 Dec 2024 12:16:05 +0100 Subject: [PATCH] Fix php error --- src/Models/Behaviors/HasSlug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Behaviors/HasSlug.php b/src/Models/Behaviors/HasSlug.php index 9f93c208f..d29a3f059 100644 --- a/src/Models/Behaviors/HasSlug.php +++ b/src/Models/Behaviors/HasSlug.php @@ -175,7 +175,7 @@ public function updateOrNewSlug(array $slugParams): void $this->slugs()->whereKey($oldMatchingSlug->getKey())->update(['active' => $isNowActive]); if ($this->relationLoaded('slugs')) { // Report update to slugs so that getSlug() returns the correct value - $slug = $this->slugs->whereKey($oldMatchingSlug->getKey()); + $slug = $this->slugs->where($this->slugs()->getModel()->getKeyName(), $oldMatchingSlug->getKey())->first(); if ($slug) { $slug->active = $isNowActive; $slug->syncOriginalAttribute('active');