PriceType::class, 'price' => 'decimal:2', ]; } public function priceFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format((float) $this->price, 0, ',', '.'), ); } public function priceInput(): Attribute { return Attribute::make( get: fn () => (string) (int) $this->price, ); } public function typeLabel(): Attribute { return Attribute::make( get: fn () => $this->type->label(), ); } public function variant(): BelongsTo { return $this->belongsTo(ProductVariant::class, 'variant_id'); } }