title: Laravel $posts->comments() isn't working here
body: <p>Here is the code from my Models:</p>
  <p><code>models/Book.php</code></p>
  <blockquote>
  <p>class Book extends \Eloquent {</p>
  <pre><code>function posts() {
      return $this-&gt;hasMany('Post');
  }
  
  function user() {
      return $this-&gt;belongsTo('User');
  }
  
  public function cover()
  {
      return $this-&gt;morphMany('Image', 'imageable');
  }
  
  public function delete()
  {
     $this-&gt;posts()-&gt;comments()-&gt;delete();
  
      $this-&gt;posts()-&gt;delete();
  
      $this-&gt;cover()-&gt;delete();
      // delete the model
      return parent::delete();
  }
  </code></pre>
  <p>}</p>
  </blockquote>
  <p><code>models/Post.php</code></p>
  <blockquote>
  <p>Class Post extends Eloquent {</p>
  <pre><code>function book() {
      return $this-&gt;belongsTo('Book');
  }
  
  function comments() {
      return $this-&gt;hasMany('Comment');
  }
  
  function user() {
      return $this-&gt;belongsTo('User');
  }
  
  public function delete()
  {
      $this-&gt;comments()-&gt;delete();
      // delete the model
      return parent::delete();
  }
  </code></pre>
  <p>}</p>
  </blockquote>
  <p><code>models/Comment.php</code></p>
  <blockquote>
  <p>Class Comment extends Eloquent {</p>
  <pre><code>function post() {
      return $this-&gt;belongsTo('Post');
  }
  
  function user() {
      return $this-&gt;belongsTo('User');
  }
  </code></pre>
  <p>}</p>
  </blockquote>
  <p>but in my <code>UserController.php</code> I cannot access my comment. I tried with these code:</p>
  <blockquote>
  <pre><code>public function show($id)
  {
          $user = User::find($id);
  
          $posts = Post::whereUserId($user-&gt;id)
                    -&gt;orderBy('created_at','deac')-&gt;get();
  
          $comments = $posts-&gt;comments();
          dd($comments);
  }
  </code></pre>
  </blockquote>
  <p>This always says:
  <img src="https://i.stack.imgur.com/lR1jR.png" alt="enter image description here" /></p>
  <p>How to access my comments under the posts? also I don't think <code>$this-&gt;posts()-&gt;comments()-&gt;delete();</code> isn't working.</p>