/** * Add a external sub-select to the query. * * @param string $column * @param \Illuminate\Database\Query\Builder|static $query * @param string $boolean * @param bool $not * @return $this */ protected function whereInExistingQuery($column, $query, $boolean, $not) { $type = $not ? 'NotInSub' : 'InSub'; $this->wheres[] = compact('type', 'column', 'query', 'boolean'); $this->addBinding($query->getBindings(), 'where'); return $this; }
/** * Add another query builder as a nested where to the query builder. * * @param \Illuminate\Database\Query\Builder|static $query * @param string $boolean * @return $this */ public function addNestedWhereQuery($query, $boolean = 'and') { if (count($query->wheres)) { $type = 'Nested'; $this->wheres[] = compact('type', 'query', 'boolean'); $this->addBinding($query->getBindings(), 'where'); } return $this; }