'users/(:num)/comments' => 'comments/index/$1',and in your comments controller use
public function index($userid = null) { }For links like /users/1/comments/new you can use the route
'users/(:num)/comments/(:any)' => 'comments/index/$2/$1',and in your comments controller use
public function new($userid = null) { }For the others, like /users/1/comments/1/show, you can use the route
'users/(:num)/comments/(:num)/(:any)' => 'comments/$3/$1/$2',and in your comments controller use
public function show($userid = null, $commentid = null) { }Define them with the longest one first.
It looks like you're new here. If you want to get involved, click one of these buttons!