title: Laravel - Pass a variable with Query Builder function
body: <p>Using Laravel's query builder example is it possible to pass a variable to this function:</p>
  
  <pre><code>$someVariable = 1;
  
  DB::table('users')
          -&gt;where('name', '=', 'John')
          -&gt;orWhere(function ($query) use ($someVariable) {
              $query-&gt;where('votes', '&gt;', $someVariable)
                    -&gt;where('title', '&lt;&gt;', 'Admin');
          })
          -&gt;get();
  </code></pre>
  
  <p>It seems the function cannot access the variable outside of itself. I get an error: Undefined variable: $someVariable</p>