diff --git a/src/Models/Concerns/HasSlugAttributeTrait.php b/src/Models/Concerns/HasSlugAttributeTrait.php index 7989f19..9c52acf 100644 --- a/src/Models/Concerns/HasSlugAttributeTrait.php +++ b/src/Models/Concerns/HasSlugAttributeTrait.php @@ -35,12 +35,12 @@ protected static function bootHasSlugAttributeTrait(): void if (! empty($changedSlugs)) { $published = true; - if (method_exists($this, 'isPublishedForDates')) { - $published = $this->isPublishedForDates($this->getOriginal('publishing_begins_at'), $this->getOriginal('publishing_ends_at')); + if (method_exists($record, 'isPublishedForDates')) { + $published = $record->isPublishedForDates($record->getOriginal('publishing_begins_at'), $record->getOriginal('publishing_ends_at')); } //dispatch event: - SlugChanged::dispatch($this, $changedSlugs, $published); + SlugChanged::dispatch($record, $changedSlugs, $published); } }); }