Illuminate\Database\Eloquent\Builder::addNestedWhereSlice PHP Метод

addNestedWhereSlice() защищенный Метод

Slice where conditions at the given offset and add them to the query as a nested condition.
protected addNestedWhereSlice ( Builder $query, array $wheres, integer $offset, integer $length = null ) : void
$query Illuminate\Database\Query\Builder
$wheres array
$offset integer
$length integer
Результат void
    protected function addNestedWhereSlice(QueryBuilder $query, $wheres, $offset, $length = null)
    {
        $whereSlice = array_slice($wheres, $offset, $length);
        $whereBooleans = collect($whereSlice)->pluck('boolean');
        // Here we'll check if the given subset of where clauses contains any "or"
        // booleans and in this case create a nested where expression. That way
        // we don't add any unnecessary nesting thus keeping the query clean.
        if ($whereBooleans->contains('or')) {
            $query->wheres[] = $this->nestWhereSlice($whereSlice, $whereBooleans->first());
        } else {
            $query->wheres = array_merge($query->wheres, $whereSlice);
        }
    }