in my controller i have $data['column1'] = 1;
It updates database with $x->update($data);
Why if add $data['column2'] = 2;
it ignores second parameter? I checked with dd($data);
and it shows both parameters. I removed default value, which being inserted by mysql, but that did not help.
Make sure that column2 is listed in the $fillable property of your model. Only attributes that are listed there can get a value assigned with your model's create/update methods.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.