*/ use HasFactory, SoftDeletes; protected $guarded = ['id']; protected function casts(): array { return [ 'type' => SalaryAdjustmentType::class, 'amount' => 'integer', ]; } protected function amountFormatted(): Attribute { return Attribute::make( get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } public function payroll(): BelongsTo { return $this->belongsTo(Payroll::class); } }