'integer', 'unit_price' => 'integer', 'total_price' => 'integer', ]; } protected function unitPriceFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->unit_price, 0, ',', '.'), ); } protected function totalPriceFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->total_price, 0, ',', '.'), ); } public function purchase(): BelongsTo { return $this->belongsTo(Purchase::class); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function product(): BelongsTo { return $this->belongsTo(Product::class); } }