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