public function getKeywordsAttribute() { $keywords = []; if ($this->terms) { foreach ($this->terms as $taxonomy) { foreach ($taxonomy as $term) { $keywords[] = $term; } } } return $keywords; }