You can use the update() method on the model to mass update records in Laravel 6. Here's an example of how you can use it to update the rows in your array:
$data = [
22 => ['col1' => 'data', 'col2' => 'data'],
31 => ['col1' => 'data', 'col2' => 'data'],
352 => ['col1' => 'data', 'col2' => 'data']
];
// Get the model for the table you want to update
$model = new YourModel();
foreach ($data as $id => $values) {
// Use the update() method to update the row with the given ID
$model->where('id', $id)->update($values);
}
This code loops through the rows in your array and uses the update() method to update each row with the given ID. The where() method is used to specify the ID to update, and the $values array is passed to the update() method to set the new values for the row.