Merge pull request #669 from awellis13/feature/where_nested-closure-fix
where_nested breaks on empty closures
This commit is contained in:
commit
4cff0907a0
|
@ -414,7 +414,10 @@ public function where_nested($callback, $connector = 'AND')
|
||||||
// Once the callback has been run on the query, we will store the nested
|
// Once the callback has been run on the query, we will store the nested
|
||||||
// query instance on the where clause array so that it's passed to the
|
// query instance on the where clause array so that it's passed to the
|
||||||
// query's query grammar instance when building.
|
// query's query grammar instance when building.
|
||||||
$this->wheres[] = compact('type', 'query', 'connector');
|
if ($query->wheres !== null)
|
||||||
|
{
|
||||||
|
$this->wheres[] = compact('type', 'query', 'connector');
|
||||||
|
}
|
||||||
|
|
||||||
$this->bindings = array_merge($this->bindings, $query->bindings);
|
$this->bindings = array_merge($this->bindings, $query->bindings);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue