title: dynamic query laravel eloquent with whereHas
body: <p>I want to create dynamic filters.<br>
  for example I want to create this code</p>
  
  <pre><code>$Contact = Contact::whereHas('User', function ($query) use ($searchString) {
          $query-&gt;where('name', 'like', '%Jhone%')-&gt;orwhere('family', '&lt;&gt;' . 'Doe');
      })-&gt;whereHas('Account', function ($query) use ($searchString) {
          $query-&gt;where('account_name', '=' , 'test_account' )-&gt;orwhere('account_city', 'like', '%test_city%');
      })-&gt;get();
  </code></pre>
  
  <p>and all of parameters is variable 
  <code>name</code>,<code>like</code>,<code>%Jhone%</code>,<code>family</code>,<code>&lt;&gt;</code>,<code>Doe</code>,.....
  and I want to pass variables to function and function create above query.</p>