PriceType::class, 'price' => 'integer', 'cost_per_unit' => 'integer', ]; } public function cutting(): BelongsTo { return $this->belongsTo(Cutting::class); } public function productVariant(): BelongsTo { return $this->belongsTo(ProductVariant::class); } public function priceFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->price, 0, ',', '.'), ); } public function costPerUnitFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->cost_per_unit, 0, ',', '.'), ); } public function typeLabel(): Attribute { return Attribute::make( get: fn () => $this->price_type->label(), ); } }