You are viewing documentation for an outdated version. It is no longer supported!

Raw Expressions

Unlike selectRaw(), whereRaw() or other equivalent methods, raw() allows you to add an expression, without prefixing, affixing or in other ways process the added expression.
The method will, however, inject binding values into the provided expression, if any are given.

Note

Raw expressions added via raw() will always be added at the end of the final assembled http query string, regardless of the order stated via the builder.

Arguments

raw() accepts the following arguments:

  • $expression: string the raw expression
  • $bindings: array (optional) binding values

Example

$response = $client
        ->raw('search=person from (:list)', [ 'list' => 'a,b,c' ])
        ->get('/users');
default
/users?search=person from (a,b,c)
json api

Caution: Produced http query is not in accordance with Json API recommendations.

/users?search=person from (a,b,c)
odata

Caution: Produced http query is not a valid OData query.

/users?search=person from (a,b,c)