$this->id, 'title' => $this->title, 'summary' => $this->summary, 'content' => $this->content, 'views' => $this->views, 'author' => new UserResource($this->whenLoaded('author')), 'category' => new CategoryResource($this->whenLoaded('category')), 'comments' => CommentResource::collection($this->whenLoaded('comments')), 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; } }