If you know in advance what the maximum number of parameters will be you can do one of the next 2.
a) If all are neccessery:
Route::get('/folder/{a}/{b}/{c}', 'PageController@getFolderTree');
b) If not all are neccessery:
Route::get('/folder/{a?}/{b?}/{c?}', 'PageController@getFolderTree');
And retrieve them like this:
public function getFolderTree($a, $b, $c) {...}
And if you don't know the maximum you will need to do a regex and explode. This would be the route:
Route::get('/folder/{any}', 'PageController@getFolderTree')
->where('any', '.*'); // Indicates that {any} can be anything
And do the explode in the controller:
public function getFolderTree($any) {
{
$params = explode('/', $any); // $params will be an array of params
}
function getFolderTree($params){//here you can access params}