I'm trying to create a dynamic route for an unlimited number of URL levels.
Here's my current route
Route::get('{pageLink}', array('uses' => 'SiteController@getPage'));
This works for the first level. So a URL like something.com/foo/ would work. But if I had something like something.com/foo/bar/ it wouldn't catch that URL. I need it to match unlimited levels. That way in my controller it'll get me a variable of whatever the entire link is.
I know I could do
Route::get('{pageLink}', array('uses' => 'SiteController@getPage'));
Route::get('{pageLink}/{pageLink2}', array('uses' => 'SiteController@getPage'));
Route::get('{pageLink}/{pageLink2}/{pageLink3}', array('uses' => 'SiteController@getPage'));
But that just seems like an overkill. Is there a better way to do this so it'll match to the end of the URL?
Thanks.