samedi 30 novembre 2019

Argument 1 passed to Illuminate\\Database\\Query\\Builder::cleanBindings() must be of the type array, string given

I update 2 data, the first data is in the normal table, the second data uses EAV, therefore I have to use where to update the data that has the input ID

What im doing wrong..im getting this error..

this my controller

this is normal table
 $vendor = Vendor::find($request->id);
        $vendor->is_active = '0';
        $vendor->name = $request->name;
        $vendor->address = $request->address;
        $vendor->save();
this is EAV Table

        $values=array('detail'=> $request->detail,
                      'join_at'=>  Carbon::now(),
                    );
        VendorDetail::whereIn('vendor_id',$request->id)->update($values);



via Chebli Mohamed

1 commentaire:

  1. the second parameter in whereIn must be an array.

    VendorDetail::whereIn('vendor_id',array($request->id))->update($values);

    RépondreSupprimer