title: Concept of table relations in Laravel
body: <p>I have two tables:</p>
  
  <ul>
  <li><code>Cards</code></li>
  <li><code>Notes</code></li>
  </ul>
  
  <p>Each <em>Card</em> has multiple <em>Notes</em>. So there is a relation between them like this:</p>
  
  <pre><code>class Card extends Model {
  
      public function notes ()
      {
          return $this-&gt;hasMany(Note::class);
      }
  }
  </code></pre>
  
  <p>Ok well, all fine.</p>
  
  <hr>
  
  <p>Now I need to understand the concept of these two lines:</p>
  
  <pre><code>$card()-&gt;$notes()-&gt;first();
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$card()-&gt;$notes-&gt;first();
  </code></pre>
  
  <p>What's the difference between them? As you see in the first one <code>$note()</code> is a function and in the second one <code>$note</code> isn't a function. How will they be translated in PHP? </p>
  
  <p>The first one points out to the <code>card</code> table and the second one points out to the <code>notes</code> table, right? or what? Anyway I've stuck to understand the concept of tham.</p>