I have a problem when i´m traying insert data in my DB. always return a message
Array to string conversion and i don´t know why. In other controller i have this code and it´s ok. And now i need to insert a data but i can´t
My actual code is:
public function insertarActuacion(){
$fechaActual = date("Y-m-d H:i:s");
$tiempoEmpleado = 0;
$bono = \DB::select(\DB::raw("SELECT codBono
FROM bonos
WHERE bonos.usuario = " . \Auth::user()->id));
$tiempoRestante = 0;
\DB::insert("INSERT INTO actuacion (fecha, tiempoEmpleado, usuario, bono, tiempoRestanteBono) VALUES (?, ?, ?, ?, ?) ",
[ $fechaActual, $tiempoEmpleado, \Auth::user()->id, $bono, $tiempoRestante ] );
}
thanks for help me
$bonobefore inserting,$bonois returning a object collection as far my knowledge. attach your debugged data with this post.