title: Laravel 5 Controller Best Practices
body: <p>I'm using Lumen as REST API. I have a Post model and a Comment Model. </p>
  
  <p>Post.php</p>
  
  <pre><code>public function comments(){
      return $this-&gt;hasMany('App\Comment');
  }
  </code></pre>
  
  <p>Comment.php</p>
  
  <pre><code>public function post(){
      return $this-&gt;belongsTo('App\Post');
  }
  </code></pre>
  
  <p>I also have Resource controllers for both these models. If I want to get all the comments on a particular post, where do I write that logic? In the PostController (because I'll be filtering comments by Post) or in the CommentController (because I'm fetching comments after all)? Which is the better way? Or is there some other way altogether (like creating a separate controller) ? I just want to get the structure right and write clean code. Any help will be greatly appreciated.</p>