laravel/framework — pull request #2734 by anlutro (2013-11-15 09:35:40+00:00)
Title: Type check of relations

Suggestion by @robclancy - would potentially give a more sane error when a relationship function doesn't return what it should, which often happens by people appending something like get() or first() inside the method.

Exception message is wrapped over two lines to not go above the 120 character hard limit. The following example would throw the exception.

```php
public function related()
{
return $this->hasMany('Other')->get(); // or first(), count()...
}

$result = $model->related;
```