Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Is there is a reason you don't just execute the raw SQL?

You can run it through DB::unprepared()

Last updated 2 years ago.
0

here's a good example of a union sql that may help:

$table1 = DB::table('table1')->select('column1', 'column2', 'column3')->orderBy('created_at', 'desc');
$table2 = DB::table('table2')->select('column1', 'column2', 'column3')->orderBy('created_at', 'desc');
$combined = $table1->union($table2);
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

neolinks neolinks Joined 12 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.