whenLoaded('pricings', function () { return $this->pricings->min('price'); }); return [ 'id' => $this->id, 'uuid' => $this->uuid, 'name' => $this->name, 'product_type' => $this->product_type, 'category' => $this->whenLoaded('category', fn() => $this->category?->name), 'cpu' => $this->cpu, 'ram' => $this->ram, 'disk' => $this->disk, 'bandwidth' => $this->bandwidth, 'setup_fee' => $this->setup_fee, 'min_price' => $minPrice, 'is_active' => $this->is_active, 'created_at' => $this->created_at, ]; } }