Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

eloquent where raw

/*
whereRaw / orWhereRaw
The whereRaw and orWhereRaw methods can 
be used to inject a raw "where" clause into your query. 
These methods accept an optional array of bindings as their second argument:
*/
$orders = DB::table('orders')
                ->whereRaw('price > IF(state = "TX", ?, 100)', [200])
                ->get();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #eloquent #raw
ADD COMMENT
Topic
Name
3+4 =