Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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);
    }
Source by www.codecheef.org #
 
PREVIOUS NEXT
Tagged: #eloquent #multiple #orwhere
ADD COMMENT
Topic
Name
7+3 =