'decimal:2', 'floated_qty' => 'decimal:2', 'allocated_qty' => 'decimal:2', 'consumed_qty' => '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 getAvailableQtyAttribute(): float { return (float) $this->on_hand_qty - (float) $this->allocated_qty; } }