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
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ public function first($columns = array('*'))
{ {
$results = $this->hydrate($this->model, $this->table->take(1)->get($columns, false)); $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;
} }
/** /**