laravel/laravel — pull request #1163 by rockiano (2012-09-02 21:33:44+00:00)
Title: Added the posibility to exclude relationships when converting a model to array

When using the $model->to_array(); function it is, possible to exclude unwanted attributes, but this is not currently possible for relationships. It is needed for example when sending the objects as json a lot the time you only need some attributes, and the relationships can cause data bloat. This is a fix for this issue, just check for the relationship name on the hidden array so it works just like with attributes.