title: Laravel - how to check if field exists in eloquent query with leftJoin and orWhere
body: <p>I have query:</p>
  
  <pre><code>$id = 16;
  
  $orders = (new Order)-&gt;where(['orders.id' =&gt; $id])
          -&gt;leftJoin('transactions', 'orders.id', '=', 'transactions.order_id')
          -&gt;leftJoin('cards', 'cards.id', '=', 'transactions.card_id')
          -&gt;orWhere('email', '=', 'aaaa@aaaa.com')
          -&gt;orWhere('last4', '=', '5555')
          -&gt;get();
  </code></pre>
  
  <p>If transactions have card everything is fine, but if card_id in transactions table is NULL error appears:
  "Column not found: 1054 Unknown column 'last4' in 'where clause".</p>
  
  <p>How I can elegant solve this ?
  How to check if column "last4" exists ?</p>
  
  <p>PS.</p>
  
  <p>last4 is in table "cards.last4"</p>