Laravel - 从具有相似行的多个表中对条目进行排序

I need to get the entries from 5 different tables with the same structure

   $test = DB::table('table1')
    ->Join('table2')
    ->Join('table3')
    ->Join('table4')
    ->Join('table5')
    ->get();

    return $test;

How can I realize that using Laravel?

The Structure from the tables:

  • id
  • title
  • default_thumb
  • video_id
  • url
  • views
  • rating
  • tags
  • created_at
  • updated_at

All 5 tables have the same structure! A problem could be id because in every table there are entrys with the same id ... 1 in all, 2 in all, 3 in all, etc.

If I use CrossJoin there is a error (out of memory) but even if I had enough memory set i will get only the entrys from table5 because the entrys from table1 to table4 got overwrited while the id's in the different tables are the same.

    $test = DB::table('table1')
    ->Join('table2', 'table1.id', '=', 'table2.id')

This is strange too! Table1 has 20 entrys with id 1 to 20, Table2 has 50 entrys with id 1 to 50.

If i do this, i will get only 20 results from table 2...