I am creating an API and I want to include both regular resources and nested resources
For example, I will say I have a Post resource and Comment resource. I have setup the appropriate routes and controllers like the following
Routes
Route::resource('posts', 'PostsControllers'); // /posts/{id}
Route::resource('comments', 'CommentsControllers'); /comments/{id}
But I also want to have comments as a nested resource of posts, like this
Nested resource route
Route::resource('posts.comments', 'PostCommentsControllers'); /posts/{id}/comments/{id}
Because I have already written my CommentsController, I would like to know of the best method to re-use the CommentsController for my PostsController
Thanks