title: Eloquent ORM: Complex left join insists on using value as column name
body: <p>I have the following Eloquent Query in one of my Models:</p>
  
  <pre><code>    return self::where('sequence', '=', $sequence)-&gt;where('interval', '=', $minutes)
          -&gt;leftJoin('wallet', 'wallet_stats.wallet_id', '=', 'wallet.id')
          -&gt;leftJoin('balance', function($join) use ($uid)
          {
              $join-&gt;on('balance.wallet_id', '=', 'wallet_stats.wallet_id')
                   -&gt;on('balance.user_id', '=', $uid);
          })
          -&gt;orderBy('volume', 'ASC')-&gt;get(['symbol', 'name', 'volume', 'start_price', 'end_price']);
  </code></pre>
  
  <p>The problem I'm having with this is the following error message:</p>
  
  <blockquote>
    <p>Oops! SQLSTATE[42S22]: Column not found: 1054 Unknown column '2' in
    'on clause' (SQL: select <code>symbol</code>, <code>name</code>, <code>volume</code>, <code>start_price</code>,
    <code>end_price</code> from <code>wallet_stats</code> left join <code>wallet</code> on
    <code>wallet_stats</code>.<code>wallet_id</code> = <code>wallet</code>.<code>id</code> left join <code>balance</code> on
    <code>balance</code>.<code>wallet_id</code> = <code>wallet_stats</code>.<code>wallet_id</code> and
    <code>balance</code>.<code>user_id</code> = <code>2</code> where <code>sequence</code> = 0 and <code>interval</code> = 1440
    order by <code>volume</code> asc)</p>
  </blockquote>
  
  <p>For some reason Eloquent insists on using the value of $uid (in the 2nd "on" join condition) as a column name rather than a literal value. </p>
  
  <p>Does anybody know how to get around that and have it accept a literal value in such a join specification?</p>