Skip to content

Conversation

@helmut
Copy link
Contributor

@helmut helmut commented Jan 17, 2013

Taking a look through the documentation here:
http://four.laravel.com/docs/eloquent#converting-to-arrays-or-json

With examples like:

return User::find(1)->toArray();

I hit the error

UnexpectedValueException: The Response content must be a string or object implementing __toString(), "array" given.

And that made me think that if you can return json why not be able to return an array and see the contents. So I modified the code in response to allow me to simply return an array and then it is displayed on the screen.

Array
(
    [id] => 1
    [name] => John Smith
)

Just playing around really but thought I might share this idea. It probably will break the entire system somehow no doubt.

@helmut
Copy link
Contributor Author

helmut commented Jan 17, 2013

The more I think about this the more I feel it is a useless feature! Think I will close this one myself...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant