vendredi 22 février 2019

Illegal offset type laravel 5.7

I want to update 4 fields with a same value, so I have done this:

UpdateModel::where('model_id', $id)->update([['is_1_ans', 'is_2_ans', 'is_3_ans', 'is_4_ans'] => 1]);

but I laravel giving me this error;

Illegal offset type

I know I'm doing wrong but I want to know how to update multiple fields with same value if needed?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire