Illuminate\Database\Query\Builder::whereInSub PHP Method

whereInSub() protected method

Add a where in with a sub-select to the query.
protected whereInSub ( string $column, Closure $callback, string $boolean, boolean $not )
$column string
$callback Closure
$boolean string
$not boolean
    protected function whereInSub($column, Closure $callback, $boolean, $not)
    {
        $type = $not ? 'NotInSub' : 'InSub';
        // To create the exists sub-select, we will actually create a query and call the
        // provided callback with the query so the developer may set any of the query
        // conditions they want for the in clause, then we'll put it in this array.
        call_user_func($callback, $query = $this->newQuery());
        $this->wheres[] = compact('type', 'column', 'query', 'boolean');
        $this->addBinding($query->getBindings(), 'where');
        return $this;
    }