I was reading the Laravel documentation and unfortunately it didn't tell me how to make composite JSON objects.
http://laravel.com/docs/master/eloquent-serialization
So right now I have two entities: User and Post and I want to return a JSON object containing the User as the parent (JSON) and Posts as the children of User (JSON) in the JSON object. There is a one-to-many relationship between User and Post.
Here is the controller method I want to change:
public function show($user)
{
return $user;
}