title: Laravel 4 - JOIN - Same column name
body: <p>I do currently use this code to retrieve the required data from my database</p>
  
  <pre><code>    $query = DB::table('packages')
          -&gt;join('assigned_packages', function($join) use($id)
          {
              $join-&gt;on('packages.id', '=', 'assigned_packages.registered_package_id')
                  -&gt;where('assigned_packages.customer_id', '=', $id);
          })
          -&gt;join('registered_packages', function($join)
          {
              $join-&gt;on('packages.id', '=', 'registered_packages.id')
                  -&gt;on('registered_packages.id', '=', 'assigned_packages.registered_package_id');
          });
  </code></pre>
  
  <p>It works fine, however the problem is that this tables have columns with the same name, and therefore only the last one is in the result. How can i fix that? Normally i would use the <code>as</code> option in the query, but i honestly do not know how I can add it to my current JOIN code from above.</p>