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 :: 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 :: Fehler beim Uploadtest der ausgewählten Datei. 
Php :: php detect daylight saving time 
Php :: how can i check that a json file already has something inside 
Php :: sub() vs substr in php 
Php :: concatenar 
Php :: how to add posts to php 
Php :: Trongate custom routing 
Php :: how to link a external modules using href in php 
Php :: woocommerce affiliate product link image to external link 
Php :: how we generate a single column migration in laravel 
Php :: laravel schedule run 
Php :: PHP strpos — Find the position of the first occurrence of a substring in a string 
Php :: yoast seo alternative for laravel 
Php :: Using Cookie Authentication 
Php :: php array dot notation 
Php :: simple-phpunit --version handling the phpunit-setup event returned with error code 127 on ubuntu 
Php :: Explicit Octal numeral notation - PHP 8.1 
Php :: What is the method of querying from two tables with a condition in Laravel 
Php :: ascii vrednosti php 
Php :: laravel view not created using foreign keys 
Php :: wordpress function _() not working 
Php :: automatically make created_by and updated_by using observer laravel 
Php :: php random string for filename 
Php :: eloquent complex queries 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =