Query/Builder.php
public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false)
    {
        [$query, $bindings] = $this->createSub($query);

        $expression = '('.$query.') as '.$this->grammar->wrap($as);

        $this->addBinding($bindings, 'join');

        return $this->join(new Expression($expression), $first, $operator, $second, $type, $where);
    }
public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false)
    {
        [$query, $bindings] = $this->createSub($query);

        $expression = '('.$query.') as '.$this->grammar->wrap($as);

        $this->addBinding($bindings, 'join');

        return $this->join(new Expression($expression), $first, $operator, $second, $type, $where);
    }
public function joinSub ( $ query , $ as , $ first , $ operator = null , $ second = null , $ type = 'inner' , $ where = false ) { [ $ query , $ bindings ] = $ this -> createSub ( $ query ) ; $ expression = '(' . $ query . ') as ' . $ this -> grammar -> wrap ( $ as ) ; $ this -> addBinding ( $ bindings , 'join' ) ; return $ this -> join ( new Expression ( $ expression ) , $ first , $ operator , $ second , $ type , $ where ) ; }
Add a subquery join clause to the query.

@param  \Closure|\Illuminate\Database\Query\Builder|string $query
@param  string  $as
@param  \Closure|string  $first
@param  string|null  $operator
@param  string|null  $second
@param  string  $type
@param  bool    $where
@return \Illuminate\Database\Query\Builder|static

@throws \InvalidArgumentException
Add a subquery join clause to the query .