Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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();
 
PREVIOUS NEXT
Tagged: #condition #true #laravel #eloquent
ADD COMMENT
Topic
Name
1+6 =