My testing
My testing

Reputation: 65

Laravel how to update multiple id values

Laravel how to update multiple id valus in table

print_r($test); exit();
Array ( [0] => 185 [1] => 216 )
$report = Test::find($test);
$report->status = "A";
$report->save();

Upvotes: 0

Views: 6394

Answers (1)

Jinandra Gupta
Jinandra Gupta

Reputation: 545

Test::whereIn('id', $test)->update(['status' => "A"]);

Good luck

Upvotes: 4

Related Questions