actor->name ?: $this->actor->username ?: 'Someone'; $slug = Str::slug((string) ($this->artwork->slug ?: $this->artwork->title)) ?: (string) $this->artwork->id; return [ 'type' => 'artwork_liked', 'artwork_id' => (int) $this->artwork->id, 'artwork_title' => $this->artwork->title, 'actor_id' => (int) $this->actor->id, 'actor_name' => $this->actor->name, 'actor_username' => $this->actor->username, 'message' => $label . ' liked your artwork', 'url' => route('art.show', ['id' => $this->artwork->id, 'slug' => $slug]), ]; } }