Fixing eloquent 2 query->first method.

This commit is contained in:
Taylor Otwell
2012-03-21 22:00:30 -05:00
parent d3af0153c1
commit 0961f8f766

View File

@@ -56,7 +56,7 @@ class Query {
{
$results = $this->hydrate($this->model, $this->table->take(1)->get($columns, false));
return (is_array($results)) ? head($results) : $results;
return (count($results) > 0) ? head($results) : null;
}
/**