title: Laravel eloquent model relationship don't work on blade template
body: <p>I have two tables:</p>
  
  <pre><code>Persons
  id, name, foto_id
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Fotos
  id, url
  </code></pre>
  
  <p>On <code>Person</code> model, I added:</p>
  
  <pre><code>public function foto() {
      return $this-&gt;hasOne("App\\Foto","id","foto_id");
  }
  </code></pre>
  
  <blockquote>
    <p>Note that I needed to escape the <code>\F</code>...</p>
  </blockquote>
  
  <p>When i try to <code>{{ $person-&gt;foto-&gt;url }}</code>, I get the <strong>"trying to access property of non-object" error</strong>. If I <code>{{ print_r($person-&gt;foto()) }}</code> I get just <code>1</code>...</p>
  
  <p>I followed the laravel docs, and this <a href="https://scotch.io/tutorials/a-guide-to-using-eloquent-orm-in-laravel" rel="nofollow">tutorial</a> </p>
  
  <p>This is a project I'm creating to learn Laravel, so any helpful advice is appreciated!</p>
  
  <p><strong>Edit:</strong><br>
  In <code>artisan tinker</code>, <code>$person-&gt;foto-&gt;url</code> work as intended, returns the <code>Foto</code> object just fine...</p>