Is there any way to add an optional parameter in the middle of a route ?
Example routes:
/things/entities/
/things/1/entities/
I tried this, but it does not work:
get('things/{id?}/entities', 'MyController@doSomething');
I know I can do this...
get('things/entities', 'MyController@doSomething');
get('things/{id}/entities', 'MyController@doSomething');
... but my question is: Can I add an optional parameter in the middle of a route?
See Question&Answers more detail:os