On my development server the JSON response from the Laravel 5 controller shows the data in the correct types.
e.g
imdb_rating: 7.6 imdb_votes: 6271 <
you can return the integer with typecasting like
return (int)Post::find(1)->id;