title: laravel eloquent union different column
body: <p>I want join this table, but the columns is different.</p>
  
  <pre><code>$user_plays_aas = DB::table('user_plays')
  -&gt;leftJoin('user_plays_aas', 'user_plays.id', '=', 'user_plays_aas.user_play_id')
  -&gt;leftJoin('aas_games', function($join) {
              $join-&gt;on('user_plays_aas.game_id', '=', 'aas_games.game_id')
                   -&gt;on('user_plays_aas.prd_id', '=', 'aas_games.prd_id');
                  })
                  -&gt;where('user_plays_aas.txn_id', $gameid);
  
  $user_plays_pp = DB::table('user_plays')
  -&gt;leftJoin('user_plays_pp', 'user_plays.id', '=', 'user_plays_pp.user_play_id')
  -&gt;leftJoin('pp_games', 'user_plays_pp.gameID', '=', 'pp_games.gameID')
  -&gt;where('user_plays_pp.roundid', $gameid);
  
  $Union= $user_plays_aas
          -&gt;unionAll($user_plays_pp );
  </code></pre>
  
  <p>How i make same columns $user_plays_aas and $user_plays_pp ? Cause Diff1 or Diff2 read as columns not as data, so make error.   </p>
  
  <pre><code>$user_plays_aas-&gt;select('Same1','Same2', 'Diff1 as PP1', 'AAS1');
  $user_plays_pp -&gt;select('Same1','Same2', 'PP1', 'Diff2 as AAS1');
  </code></pre>
  
  <p>Thanks</p>