public static function borrarProducto($input) { $respuesta = array(); $reglas = array('id' => array('integer')); $validator = Validator::make($input, $reglas); if ($validator->fails()) { $respuesta['mensaje'] = $validator; $respuesta['error'] = true; } else { if (is_null(Session::get('carrito'))) { Carrito::agregar($input); } $producto = Producto::find($input['producto_id']); $carrito = Carrito::find(Session::get('carrito')); $datos[$producto->id] = array('fecha_baja' => date("Y-m-d H:i:s"), 'estado' => 'B'); $carrito->productos()->sync($datos, false); Cart::remove($input['rowId']); $respuesta['mensaje'] = 'Producto carrito borrado.'; $respuesta['error'] = false; $respuesta['data'] = $carrito; } }