'date', 'total' => 'integer', ]; } protected function totalFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->total, 0, ',', '.'), ); } public function items(): HasMany { return $this->hasMany(PurchaseItem::class); } }