Answer the question
In order to leave comments, you need to log in
Laravel mysql update to multiple lines?
How can I update several rows at once with different parameters?
View parameters: id - value
Now I go through them in a loop and get a separate query for each value:
User::where('id', 1)->update(['value' => 'abc']);
User::where('id', 2)->update(['value' => 'qwe']);
Answer the question
In order to leave comments, you need to log in
Для разных моделей(по ID как у вас) никак, да и смысла нет, длина записи такая же была бы.
Только если изменение всех сразу по общим признакам и на одно значение новое: https://laravel.com/docs/5.3/eloquent#updates
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question