Skip to content

Commit

Permalink
Fix php error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel committed Dec 11, 2024
1 parent bd18763 commit 5a5dda0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Behaviors/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
if ($slug) {
$slug->active = $isNowActive;
$slug->syncOriginalAttribute('active');
Expand Down

0 comments on commit 5a5dda0

Please sign in to comment.