Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to use or where in laravel

if (!empty($search)){
            $member = $member->where(function($q)use($search){$q->where('name', 'LIKE',  '%' . $search . '%')->orWhere('contact', 'LIKE',  '%' . $search . '%')->orWhere('contact02', 'LIKE',  '%' . $search . '%')->orWhere('email', 'LIKE',  '%' . $search . '%')->orWhere('blood_group', 'LIKE',  '%' . $search . '%'); });
  
        }
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel
ADD COMMENT
Topic
Name
3+1 =