Загрузка данных


// Service.php
class Service extends Model
{
    use HasFactory;
    protected $fillable = ['name', 'description', 'price', 'duration_minutes'];
    
    public function repairOrders()
    {
        return $this->belongsToMany(RepairOrder::class, 'order_services');
    }
}

// Part.php
class Part extends Model
{
    use HasFactory;
    protected $fillable = ['name', 'article_number', 'description', 'purchase_price', 'selling_price', 'stock_quantity', 'min_stock_quantity'];
    
    public function repairOrders()
    {
        return $this->belongsToMany(RepairOrder::class, 'order_parts');
    }
}