Fixing eloquent 2 query->first method.
This commit is contained in:
parent
d3af0153c1
commit
0961f8f766
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue