'decimal:2', 'actual_hours' => 'decimal:2', 'bundle_quantity' => 'decimal:2', 'bundle_unit_rate' => 'decimal:2', ]; } public function task(): BelongsTo { return $this->belongsTo(Task::class); } public function labor(): BelongsTo { return $this->belongsTo(Labor::class); } public function getEstimatedCostAttribute(): float { return (float) $this->estimated_hours * (float) ($this->labor?->hourly_rate ?? 0); } public function getActualCostAttribute(): float { return (float) $this->actual_hours * (float) ($this->labor?->hourly_rate ?? 0); } }