title: Read the array inside the query scope
body: <p>I have an array in $genreArr, i want it to be readable in the line whithin the function(query) inner select:</p>
  
  <pre><code>    if($genreArr){
          $movies = DB::table('movie_list')-&gt;whereIn('movie_id',function($query){     
              $query-&gt;select(DB::raw('movie_id'))
                        -&gt;from('movie_genre')
                        -&gt;whereIn('genre_id',$genreArr)
                        -&gt;distinct();
          })-&gt;orderBy(DB::raw('RAND()'))-&gt;take(10)-&gt;get();
      }
  </code></pre>
  
  <p>How do i do that without using global variables, i tried pass that variable as the second param next to the $query and than it gives me this kind of error:</p>
  
  <pre><code>Missing argument 2 for MovieController::{closure}()
  </code></pre>