laravel/laravel — pull request #1372 by raftalks (2012-10-19 19:57:15+00:00)
Title: Allow Fluent DB Find method to pass Primary Key field

In the Database Query class, Find method is hardcoded to use id column of a table. With joins, that might become ambiguous as well and having different primary key field in a table will not work with the method.

Therefore, I am submitting this small hack to allow the $columns parameter to work either as an array of columns or a string defining the primary key(look up fieldname) or use the third parameter to define the primary key if array columns are required.

Examples:

DB::('countries')->find($id) or
DB::('countries')->find($id, array $columns) or
DB::('countries')->find($id, 'countries.isocode')
DB::('countries')->find($id, $columns, 'countries.isocode')

This can also be a solution to the following issue
https://github.com/laravel/laravel/issues/1050