public function creating(Notification $notification) { /** @var \App\Core\Notification\Notification $notificationClass */ $notificationClass = $notification->type; $notification->setAttribute('type', $notificationClass::getType()); }