$this->id, 'title' => $this->title, 'slug' => $this->slug, 'summary' => $this->summary, 'excerpt' => $this->getExcerpt(200), 'content_type' => $this->content_type, 'content_type_label' => $this->getContentTypeLabel(), 'featured_image_url' => $this->featured_image_url, 'featured_image_alt' => $this->featured_image_alt, 'author_name' => $this->author_name, 'is_pinned' => $this->is_pinned, 'published_at' => $this->published_at?->toIso8601String(), 'categories' => CategoryResource::collection($this->whenLoaded('categories')), 'tags' => $this->whenLoaded('tags', function () { return $this->tags->map(fn ($tag) => [ 'name' => $tag->name, 'slug' => $tag->slug, ]); }), ]; } }