Search
 
SCRIPT & CODE EXAMPLE
 

PHP

condition for both of one should be true laravel eloquent

WHERE age < 6 OR (age > 8 AND name IN ('Jane', 'Jerry'))
  
return AppDogs::select('name', 'age')
    ->where('age','<', 6)
    ->orWhere(function($q){
        $q->where('age','>', 8);
        $q->whereIn('name', ['Jane', 'Jerry']);
    })
    ->get();
Comment

PREVIOUS NEXT
Code Example
Php :: implode (PHP 4, PHP 5, PHP 7, PHP 8) implode — Join array elements with a string 
:: PHP readfile() Function 
Php :: how to search like username,email and phone number in php 
Php :: Php excel from Z to AA 
Php :: merge cell collumn phpOffice 
Php :: php firebase sdk cloud messaging initialization 
Php :: Who developed Laravel? 
Php :: php check timeout 
Php :: Command "make:auth" is not defined. 
:: codeigniter input required function in php 
Php :: php tutorials account ledger 
Php :: lervel php 
Php :: Writing a New Block for Cryptocurrency Blockchain 
Php :: laravel title dynamic 
Php :: Parse error: syntax error, unexpected token "implements" in C:xampphtdocsmastervendoryiisoftyii2aseObject.php on line 78 
Php :: generate hash password in laravel online 
Php :: how to disable the plugins and theme editor 
Php :: null safe operator in php 
Php :: how to call a function in model from a controller 
Php ::  
Php :: envoyer mail php depuis localhost 
Php :: laravel creating event get data 
Php :: mobibeDetect 
Php :: acf select multiple choice array in loop 
Php :: detect change in log file in real time php 
Php :: PHP include causes white space at the top of the page 
Php :: add p tag back in wordpress 
Php :: remove public from url laravel 7 
Php :: carbon 
Php :: mysql.service: Start request repeated too quickly 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =