'Error Object of class stdClass could not be converted to string

can any one tell me what am i doing wrong here?

 $getIDtascart = DB::table('temp_cart')->where('id_user',$getUser)->select('id_tas')->get();
 TasRajut::destroy($getIDtascart);

$getIDtascart is array

thankyou

EDITED :

the error in stack trace is PDOStatement::bindValue . this is full error

$statement->bindValue(

                is_string($key) ? $key : $key + 1,

                $value,

                $pdoParam
            );

thankyou



Solution 1:[1]

if you want to delete some records data try to use ->delete() instead ->get()

$getIDtascart = DB::table('temp_cart')->where('id_user',$getUser)->select('id_tas')->delete();

and you no longer need this line

TasRajut::destroy($getIDtascart);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kebis