belongsTo(User::class); } public function getWordsAsCollection(): Collection { return str($this->words)->explode(',') ->map(fn ($word) => trim(strtolower($word))) ->filter(fn ($word) => strlen($word) > 0); } public function getWordsAsArray(): array { return $this->getWordsAsCollection()->toArray(); } }