if
and else
statements like you would expect.when
helper method.when
builder
object as the only parameter.builder
object as the only parameter.false
when
helper is used to allow conditional statements when defining queries without using if statements and having to store temporary variables.else
case.when
callbacks are automatically scoped and grouped. That means that if a where clause is added inside the callback with an OR
combinator the clauses will automatically be grouped (have parenthesis put around them.) You can disable this feature by passing withoutScoping = true
to the when
callback.