i am using laravel 5.2 and trying to update records using whereIn('id',[1,2])
but when i try to pass a json value [1,2] to it , i returns parameterize() must be of the type array, string given. I am mentioning my code below.
$load_id=json_encode($request->chk_load,JSON_NUMERIC_CHECK); // it returns [1,2]
Load::whereIn('id',$load_id)->update(array('status'=>3));
What should i do to fix this error. ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire