'integer', 'paid_at' => 'datetime', ]; } // 3. Attribute public function amountFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } public function paidAtFormatted(): Attribute { return Attribute::make( get: fn () => $this->paid_at?->translatedFormat('l, d F Y H:i'), ); } // 4. Relation public function cashTransaction(): BelongsTo { return $this->belongsTo(CashTransaction::class); } public function employeeAdvance(): BelongsTo { return $this->belongsTo(EmployeeAdvance::class); } public function paidBy(): BelongsTo { return $this->belongsTo(User::class, 'paid_by_id')->withTrashed(); } }