maybe put it within another array?
echo Response::json(array('data' => array(array('name' => 'Test'))));
Use this package awesome....
"league/fractal": "0.8.*"
You could always do something like this, in filters.php
:
App::after(function($request, $response)
{
if ($response instanceof Symfony\Component\HttpFoundation\JsonResponse)
$response->setData(['result' => $response->getData()]);
});
Note that I used result here rather than data, if you prefer data then just change it
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community