When I use json_encode in the update query builder of laravel, it returns empty. The code I tried was this:
DB::table('catalog_product')->update([
'reference' => json_encode(['data' =>DB::raw('external_barcode')]),
]);
How do I do this?
reference, what isexternal_barcode? etc.json_encode()function, or useJSON_OBJECTfunction in mysql. But you'll need key / value to encode a value.