*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'title' => $this->title, 'slug' => $this->slug, 'content' => $this->content, 'excerpt' => $this->excerpt, 'featured_image' => $this->featured_image, 'is_featured' => (bool) $this->is_featured, 'status' => $this->status, 'published_at' => $this->published_at?->toISOString(), 'category' => new CategoryResource($this->whenLoaded('category')), 'created_at' => $this->created_at?->toISOString(), 'updated_at' => $this->updated_at?->toISOString(), ]; } }