nested resource controller laravel 4
laravel, laravel-4, php
Solution
in route.php
Route::resource('articles.comments','commentsController');
in controller
public function show($articleId, $comment) {}
public function create($articleId) {}
Problem
In laravel 4 i would like to have a nested controller. I have read the documentation but didn't find any explanation on how to do it. Supose that in a app i have some articles and each article have his own set of comments. I would like to be able to get all comment of a specific article by accessing a URL like this. http://myapp.com/articles/5/comments I have created a commentsController, but i don't know how to correctly get the article id from the url, so i can pass it to all my CRUD methods in my controller