jeudi 26 avril 2018

Parameterize() must be of the type array, string given in Laravel 5.2

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. ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HYxaM1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire