I have this array extracted from a db record using Laravel:
$deal = DB::table('deals')->where('id', Input::json('id'))->get();
Array
(
[0] => stdClass Object
(
[id] => 10001
[status] => 1
[images] => {main: '1.jpg',portfolio: ['1.jpg','2.jpg','3.jpg','4.jpg']}
)
)
Before returning the data to the client, I need the [images] value to be json_decoded, and re-inserted into the object. I tried this:
$json = $deal[0]['images'];
$images = json_decode($json);
Which already returns this error: Cannot use object of type stdClass as array
What am I doing wrong?