title: Laravel Eloquent query builder getting confused with 'or' operator in sql
body: <p>How to write laravel eloquent for the below SQL query ?
     username,first_name,last_name and email are column names.</p>
  
  <pre><code> select * from `message_users` where `username` like %somthing% and (`first_name` like %somthing% or `last_name` like %somthing%) and `email` like %something%
  </code></pre>
  
  <p>I've tried this </p>
  
  <pre><code>$queryObj= $this;
          if(!empty($filter['username']))
              $queryObj = $queryObj-&gt;where('username','like','%'.$filter['username'].'%');
          if(!empty($filter['name'])){
              $queryObj = $queryObj-&gt;where('first_name','like','%'.$filter['name'].'%');
              $queryObj = $queryObj-&gt;orWhere('last_nam','like','%'.$filter['name'].'%');
          }
  
          if(!empty($filter['email']))
              $queryObj = $queryObj-&gt;where('email','like','%'.$filter['email'].'%');
  
          $result = $queryObj-&gt;orderBy('id','DESC')-&gt;paginate($limit);
          return $result;
  </code></pre>
  
  <p>but this builds query without round brackets. Which don't give me a correct result!</p>
  
  <pre><code>select * from `message_users` where `username` like %somthing% and `first_name` like %somthing% or `last_name` like %somthing% and `email` like %something%
  </code></pre>