$this->id, 'name' => $this->name, 'email' => $this->email, 'message' => $this->message, 'ip_address' => $this->ip_address, 'status' => $this->status, 'created_at' => $this->created_at->toISOString(), 'updated_at' => $this->updated_at->toISOString(), 'deleted_at' => $this->deleted_at?->toISOString(), // Связи (загружаются только если были eager loaded) 'comments' => CommentResource::collection($this->whenLoaded('comments')), 'tags' => TagResource::collection($this->whenLoaded('tags')), 'attachments' => AttachmentResource::collection($this->whenLoaded('attachments')), // Счетчики 'comments_count' => $this->whenCounted('comments'), 'tags_count' => $this->whenCounted('tags'), ]; } }