true
Expression
object from which the query is based. Alternatively, a configured JoinClause
instance can be passed.false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
"inner"
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use the dedicated joinWhere
or a join closure where possible.=
as the operator, you can omit it and pass just the column names:Expressions
are also supported as the table
argument (though you may prefer the readability of the joinRaw
method):raw
will most likely tie your code to a specific database, so think carefully before using the raw
method if you want your project to be database agnostic.JoinClause
can also be passed to the join function. This allows you to extract shared pieces of code out to different functions.true
false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
WHERE
clause instead of an ON
clause. WHERE
clauses introduce parameters and parameter bindings whereas on
clauses join between columns and don't need parameter bindings.first
. This allows multiple on
and where
conditions to be applied to the join. See the documentation for join
for more information.true
false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
"inner"
leftJoinRaw
and rightJoinRaw
where possible.false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.joinRaw
matches the join
method. Additionally, there are leftJoinRaw
, rightJoinRaw
, and crossJoinRaw
methods available.joinRaw
will most likely tie your code to a specific database, so think carefully before using the joinRaw
method if you want your project to be database agnostic.true
true
QueryBuilder
instance or a function to define the derived query.true
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
"inner"
leftJoinSub
and rightJoinSub
where possible.false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.join
method applies to constrain the query. The derived table can be defined using a QueryBuilder
instance:true
Expression
object from which the query is based. Alternatively, a configured JoinClause
instance can be passed.JoinClause
instance may have a different join type than a left
join. The JoinClause
instance's join type will be used.)false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.true
false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.leftJoinRaw
matches the join
method.leftJoinRaw
will most likely tie your code to a specific database, so think carefully before using the leftJoinRaw
method if you want your project to be database agnostic.true
true
QueryBuilder
instance or a function to define the derived query.true
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.joinSub
method applies to define and constrain the query.true
Expression
object from which the query is based. Alternatively, a configured JoinClause
instance can be passed.JoinClause
instance may have a different join type than a right
join. The JoinClause
instance's join type will be used.)false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.true
false
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.rightJoinRaw
matches the join
method.rightJoinRaw
will most likely tie your code to a specific database, so think carefully before using the rightJoinRaw
method if you want your project to be database agnostic.true
true
QueryBuilder
instance or a function to define the derived query.true
Expression
to join the table on. Alternatively, a function can be passed to configure complex join statements.false
"="
false
false
second
should be interpreted as a column or a value. Passing this as an argument is discouraged. Use a closure to define the where clauses where possible.joinSub
method applies to define and constrain the query.true
Expression
object from which the query is based. Alternatively, a configured JoinClause
instance can be passed.JoinClause
instance may have a different join type than a cross
join. The JoinClause
instance's join type will be used.)true
on
or where
clauses.crossJoinRaw
will most likely tie your code to a specific database, so think carefully before using the crossJoinRaw
method if you want your project to be database agnostic.true
true
QueryBuilder
instance or a function to define the derived query.QueryBuilder
instance or a function just as with joinSub
. Cross joins cannot be constrained, however.true
false
"inner"
inner
, left
, right
, or cross
.JoinClause
. A JoinClause
is a specialized version of a QueryBuilder
. You may call on
or orOn
to constrain the JoinClause
. You may also call any where
methods.JoinClause
directly is useful when you need to share a join between different queries. You can create and configure the JoinClause
in a function and pass it to queries as needed.JoinClause
can be passed to join
, leftJoin
, rightJoin
, and crossJoin
, the type of the JoinClause
will override the type of the function.JoinClause
is a specialized version of a QueryBuilder
. You may call on
or orOn
to constrain the JoinClause
. You may also call any where
methods.false
Expression
of the condition. Alternatively, a function can be passed to nest conditions with parenthesis.false
"="
false
"and"
JoinClause
. An alias for whereColumn
.