title: Trying to get property on non-object
body: <p>I'm having a problem with this line of codes.</p>
  
  <pre><code>foreach ($entity as $info) {
      $ent_login = Entity::select('loginid')-&gt;where('entityid', $info-&gt;entityid)-&gt;first();
      $ent_email = User::select('email')-&gt;where('loginid', $ent_login-&gt;loginid)-&gt;first();
      $info-&gt;basic_email = $ent_email-&gt;email;
  }
  </code></pre>
  
  <p>I tried runnig this in my local but it's working. When I tried pushing it on the server it keeps saying <code>Trying to get property 'email' of non-object</code> on the last line. What seems to be the problem?</p>