Search
 
SCRIPT & CODE EXAMPLE
 

PHP

eloquent whereRaw

$orders = DB::table('orders')
                ->whereRaw('price > IF(state = "TX", ?, 100)', [200])
                ->get();

#To use in search
$paciente   = $query->whereRaw("(
        LOWER(name)             like '%". strtolower($search) ."%' OR
        LOWER(sku)              like '%". strtolower($search) ."%' OR
        LOWER(codigo)           like '%". strtolower($search) ."%' OR
        LOWER(descricao_curta)  like '%". strtolower($search) ."%'
    )");
Comment

PREVIOUS NEXT
Code Example
Php :: php mkdir with 777 permission 
Php :: flutter network image svg 
Php :: dompdf laravel page break 
Php :: PHP (WordPress) - Increase Maximum Upload File Size 
Php :: mkdir permission denied php 
Php :: php loop object 
Php :: php date from format 
Php :: model json laravel accessor to convert to array 
Php :: laravel exists eloquent 
Php :: shortcut vsc select line up 
Php :: php pdo check if update query successful 
Php :: laravel translate 
Php :: php validate date format yyyy-mm-dd 
Php :: php constant array 
Php :: display time php 
Php :: laravel drop table column 
Php :: laravel 4.2 migration 
Php :: laravel 8 get app folder 
Php :: ubuntu fopen failed to open stream: Permission denied 
Php :: php year from date 
Php :: store image in storage laravel 
Php :: allowed memory size of bytes exhausted composer 
Php :: Modes for File Read PHP 
Php :: create project laravel 
Php :: livewire not working 
Php :: php exec without waiting 
Php :: create livewire component 
Php :: php convert string to boolean 
Php :: send multiple mail in laravel 
Php :: laravel range query 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =