taylorotwell/eloquent — pull request #7 by jaysonic (2012-01-31 07:43:34+00:00)
Title: Specifying array of columns in Eloquent models

This allows you to specify an array of columns to the getters of Eloquent, **get**, **all**, **first** and **paginate**. This adds the same behaviour that the Fluent Query Builder already has.

Things like this are now available with Eloquent:

~~~~
Member::find(1, array('username', 'email'));
~~~~

It should be noted when using relationships that the foreign key must be selected as well or errors will be thrown. For example, when trying to get a members group you must also select the **group_id** column.

~~~~
Member::with('group')->where('id', '=', 4)->first(array('id', 'group_id', 'username', 'email'));
~~~~