*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'name' => $this->name, 'slug' => $this->slug, 'description' => $this->description, 'is_active' => $this->is_active, 'sort_order' => $this->sort_order, 'created_at' => $this->created_at?->toISOString(), 'updated_at' => $this->updated_at?->toISOString(), // Relationships (loaded when needed) // 'clients_count' => $this->whenCounted('clients'), // 'clients' => ClientResource::collection($this->whenLoaded('clients')), ]; } }