I have two table application_requests and transactions in both the tables there may be matching record or may not be. For any condition i want record from both the tables.
In transactions table there is a foreign key column application_request_id (this has value of reference of primary key in application_requests table).. If this condition matched then it should display as one row (or record).
I dont know how to achieve this in laravel.
I have tried below codes but its not working:
$a = \DB::table('application_requests')->select('id');
$b = \DB::table('transactions')->select('application_request_id');
$results = $b->union($a)->get();
echo "<pre>";
print_r($results);die;