title: How to nest WHERE plus AND conditions with laravel query builder?
body: <p>I need something like this:  </p>
  
  <pre><code>public function myFunc(Request $request) {
      $search = $request-&gt;input('searchString');
      $myOjb = myModel::where('field1', 'like', '%' .$search . '%')
                      -&gt;orwhere('field2', 'like', '%' .$search . '%')
                      -&gt;orwhere('field3', 'like', '%' .$search . '%')
                      -&gt;orwhere('field4', 'like', '%' .$search . '%')
                      -&gt;where('field5','yes')
  
  }
  </code></pre>
  
  <p>I need to bring data where any of those <code>like</code> are true AND field <code>field5 = yes</code> is a MUST BE.  </p>
  
  <p>The problem is: It brings me data even if <code>field5</code> is not found.<br>
  How to filter it correctly?</p>
  
  <p>Didn't understand enough: <a href="https://laravel.com/docs/5.4/queries#where-clauses" rel="nofollow noreferrer">Advanced Wheres</a></p>