I have saved some Json data in a MySQL column. While fetching the data to a Laravel Blade application the json fields are all escaped. Hence, I am facing issues while reading the json data.
[
{
"id": "1",
"json_backup": "{\"id\":\"2\",\"organization_id\":\"1\",\"amount\":\"7800.00\",\"date\":\"2015-05-11\",\"created_at\":\"2015-05-11 07:20:45\",\"updated_at\":\"2015-05-11 07:20:45\"}",
"ip": "127.0.0.1",
"created_at": "2015-05-12 12:21:16",
"updated_at": "2015-05-12 12:21:16"
}
]
The json_backup field in the above example is escaped. How do I ensure that this field is not escaped.
Code to fetch the data
$activity = Activity::find(1);
In the View:
@foreach ($activities AS $activity)
@foreach($activity->json_backup AS $order)
@endforeach
@endforeach
Error:
Invalid argument supplied for foreach()
Any help would be much appreciated.