I have an array in $genreArr, i want it to be readable in the line whithin the function(query) inner select:

```
    if($genreArr){
        $movies = DB::table('movie_list')->whereIn('movie_id',function($query){     
            $query->select(DB::raw('movie_id'))
                      ->from('movie_genre')
                      ->whereIn('genre_id',$genreArr)
                      ->distinct();
        })->orderBy(DB::raw('RAND()'))->take(10)->get();
    }

```

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:

```
Missing argument 2 for MovieController::{closure}()

```