Why not use an Eloquent model and cast the column as json?
https://laravel.com/docs/9.x/eloquent-mutators#array-and-json-casting
Otherwise, if you must use the Query Builder, you will need to map/transform the Collection and json_decode the relevant column(s):
$data = DB::table('data')
->select('data.*')
->orderBy('name')
->get()
->transform(function ($obj) {
return tap($obj, fn ($o) => $o->column_name = json_decode($o->column_name));
});
return $data;
The transform operation maps over the objects in the Collection changing the column_name property for a json-decoded version of same.