Search
 
SCRIPT & CODE EXAMPLE
 

PHP

eloquent multiple orwhere

public function index()
    {
        $search = AppModel::all();
  
        $users = User::select("*")
                        ->where('status', 1)
                        ->where(function($query) use ($search){
                            $query->where('first_name', 'LIKE', '%'.$search.'%')
                                  ->orWhere('last_name', 'LIKE', '%'.$search.'%')
                                  ->orWhere('email', 'LIKE', '%'.$search.'%');
                        })
                        ->get();
  
        dd($users);
    }
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress change email new user template 
Php :: php date now 
Php :: php $_session err_miss_cache 
Php :: how to fetch days old records php mysql 
Php :: console_log in php 
Php :: cakephp group by count 
Php :: Get the current script file name 
Php :: laravel install 
Php :: php multiplei str 
Php :: phpmailer doesnt work 
Php :: run new oroject laravel with idff port 
Php :: blade Keep input values after failed validation 
Php :: send data with url in php 
Php :: php check if input is a positive integer 
Php :: docker php-fpm-apline add imagick 
Php :: Add current year on WordPress using Shortcode 
Php :: guzzlehttp http_errors get 
Php :: update php local 
Php :: laravel get current user id 
Php :: save big data with laravel 
Php :: how to integrate google reCAPTCHA in codeigniter? 
Php :: phph call functions from other .php file 
Php :: laravel route regex except 
Php :: blade format date 
Php :: laravel telescope tutorial 
Php :: prevent xss attack in laravel 
Php :: how to get post by comment in laravel 
Php :: php round function syntax 
Php :: if certain condition is met exit if block php 
Php :: cpanel composer update kill 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =