title: Is there any way to return all rows when parameter is empty in laravel eloquent?
body: <p>This is my code to filter values based on parameters.  I want to move it into to a single line. Is there any option available in laravel4? </p>
  
  <pre><code>    if($network) //when $network variable has a value.(i will have the same thing for orderby, customer, etc..)
      {
          return  $deals=$mobiles-&gt;deals()-&gt;where('network','=',$network)-&gt;get();// -&gt;orderby($orderby);
      }
      else
      {
          return  $deals=$mobiles-&gt;deals()-&gt;get();
  
      }
  </code></pre>