FrozenNode/Laravel-Administrator — pull request #703 by Ifnot (2014-10-02 08:27:20+00:00)
Title: [Fix] Non relation methods converted to Collection

Hello,

A little fix for the Field Factory : when you try to get access to a non eloquent method of an object an eloquent exception is raised.

The reason ?

-> By default Field Factory try to check if all found methods are eloquent relations, wheras if it is a standard method it fail (Field Factory is calling the attribute name, it query the eloquent model to resolve to do an implicit relation on it and fails).

Solution ?

-> Simply try to resolve relations only when the option "relationship" is defined for the attribute.