title: Full outer join query in laravel 5.4
body: <p>I have two table <strong>application_requests</strong> and <strong>transactions</strong> in both the tables there may be matching record or may not be. For any condition i want record from both the tables.</p>
  
  <p>In <strong>transactions</strong> table there is a foreign key column <strong>application_request_id</strong> (this has value of reference of primary key in <strong>application_requests</strong> table).. If this condition matched then it should display as one row (or record).</p>
  
  <p>I dont know how to achieve this in laravel.</p>
  
  <p>I have tried below codes but its not working:</p>
  
  <pre><code>    $a = \DB::table('application_requests')-&gt;select('id');
  
      $b  = \DB::table('transactions')-&gt;select('application_request_id');
  
      $results = $b-&gt;union($a)-&gt;get();
  
      echo "&lt;pre&gt;";
      print_r($results);die;
  </code></pre>
  
  <p>transactions table is
  <a href="https://i.stack.imgur.com/au9VZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/au9VZ.png" alt="enter image description here"></a></p>
  
  <p>And my application_requests table is
  <a href="https://i.stack.imgur.com/Th4vf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Th4vf.png" alt="enter image description here"></a></p>