title: How to add if condition inside eloquent laravel 5.4
body: <p>I'm using <code>Laravel 5.4</code> and this code work properly without <code>if</code> conditions, when i try to add it i got errors and this message appear : </p>
  
  <blockquote>
    <p>syntax error, unexpected 'if' (T_IF) OR  syntax error, unexpected '->'
    (T_OBJECT_OPERATOR)</p>
  </blockquote>
  
  <p>any help please?</p>
  
  <pre><code>   $moviesearch = DB::table('movies')
       -&gt; join('qualities', 'movies.mov_ID', '=', 'qualities.mov_ID')
       -&gt; join('genres', 'movies.mov_ID', '=', 'genres.mov_ID')
           if (isset($age)) {
               -&gt;where('movies.name', '=', '1')
           }
           if (isset($jkk)) {
               -&gt;where('qualitie.link', '=', '233')
           }
       -&gt;get();
  
   echo json_encode($moviesearch);
  </code></pre>