'decimal:2', 'unit_cost' => 'decimal:2', ]; } public function project(): BelongsTo { return $this->belongsTo(Project::class); } public function material(): BelongsTo { return $this->belongsTo(Material::class); } public function getLineTotalAttribute(): float { return (float) $this->estimated_qty * (float) $this->unit_cost; } }