title: Eloquent findOrFail on Relationship
body: <p>Say that <code>$post</code> is a <code>Post</code> model in eloquent and it has many <code>Comment</code> models related.</p>
  
  <p>Here is the post model:</p>
  
  <pre class="lang-php prettyprint-override"><code>/**
   * Get comments.
   */
  public function comments()
  {
      return $this-&gt;hasMany('App\Models\Comment');
  }
  </code></pre>
  
  <p>I am trying to retrieve a comment that belongs to the post by its <code>id</code>. Running the following code will return the comment if the comment exists, but it does not take into account if it belongs to that post (relationship). This allows users to retrieve comments even if they are not on the current post.</p>
  
  <pre class="lang-php prettyprint-override"><code>$comment = $post-&gt;comments()-&gt;findOrFail($commentId);
  </code></pre>
  
  <p>The following returns a collection first and then finds the correct comment by <code>id</code>. </p>
  
  <pre class="lang-php prettyprint-override"><code>$comment = $post-&gt;comments-&gt;find($commentId);
  </code></pre>
  
  <p>However, I need the <code>findOrFail()</code> method via the Query Builder instead of the <code>find()</code> method on a collection to return an exception instead of getting an <code>undefined error</code> when trying to access a property of the comment.</p>