It doesn't look like you have the associations setup properly. Instead of your current method, you should build an array where you have ['checkedID'=>'number'] and then just do a foreach loop to update the rows:
foreach ($arr as $id => $number) Products::where('id',$id)->update(['number'=>$number])
jeremybalog said:
It doesn't look like you have the associations setup properly. Instead of your current method, you should build an array where you have ['checkedID'=>'number'] and then just do a foreach loop to update the rows:
foreach ($arr as $id => $number) Products::where('id',$id)->update(['number'=>$number])
Thanks a lot, this has worked for me in the end after playing around with the arrays!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community