Answers for "condition for both of one should be true laravel eloquent"

PHP
0

condition for both of one should be true laravel eloquent

WHERE age < 6 OR (age > 8 AND name IN ('Jane', 'Jerry'))
  
return \App\Dogs::select('name', 'age')
    ->where('age','<', 6)
    ->orWhere(function($q){
        $q->where('age','>', 8);
        $q->whereIn('name', ['Jane', 'Jerry']);
    })
    ->get();
Posted by: Guest on July-10-2020

Code answers related to "condition for both of one should be true laravel eloquent"

Browse Popular Code Answers by Language