Skip to content
Advertisement

laravel update database multiple records

I am new to Laravel. I’m simply trying to update a full row of mysql table. Data are being sent from a form. I only get to have only 2 records updated and the rest go NULL. I am sure that the fields names from Controller are matching input fields names in the form, also in the mysql table. I also made sure that fields listed in “fillable” method in the model.

In the controller tried:

JavaScript

I also tried

JavaScript

Plz let me know what I might be doing wrong. Thank you

Advertisement

Answer

use DB facade, I was having an error similar to this, so this is what I used

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement