Working on API

This commit is contained in:
Hillel Coren 2014-05-13 22:48:02 +03:00
parent 561907ae60
commit d42712204c
2 changed files with 11 additions and 7 deletions

View File

@ -13,7 +13,7 @@ return array(
| |
*/ */
'debug' => true, 'debug' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -16,12 +16,16 @@ class ClientApiController extends \BaseController {
public function index() public function index()
{ {
$clients = Client::scope()->get()->toArray(); $clients = Client::scope()->get();
return Response::json(array( $response = [
'error' => false, 'status' => 200,
'clients' => $clients), 'error' => false,
200 'clients' => $clients->toArray()
); ];
$response = json_encode($response, JSON_PRETTY_PRINT);
return Response::make($response, 200, ['Content-Type' => 'application/json']);
} }
} }