'integer', 'subtotal' => 'integer', 'unit_price' => 'integer', ]; } // 3. Attribute public function quantityFormatted(): Attribute { return Attribute::make( get: fn () => "{$this->quantity} pcs", ); } public function quantityInput(): Attribute { return Attribute::make( get: fn () => (string) $this->quantity, ); } public function subtotalFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } public function unitPriceFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->unit_price, 0, ',', '.'), ); } // 4. Relation public function restock(): BelongsTo { return $this->belongsTo(Restock::class)->withTrashed(); } public function productVariant(): BelongsTo { return $this->belongsTo(ProductVariant::class)->withTrashed(); } public function user(): BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } }