Does it work with this?
'/[{id}]'
I could imagine that it might be a problem if there is "nothing" but an optional parameter in the route path.
For some reason if you write a route inside a group only with a optional parameter, Lumen will return 404. For example:
$router->group(['prefix' => 'client'], function () use ($router) {
$router->get('[/{id}]', ['as' => 'findClient', 'uses' => 'ClientController@find']);
});
However, if I write:
$router->get('/client[/{id}]', ['as' => 'findClient', 'uses' => 'ClientController@find']);
It works. It also works:
$router->group(['prefix' => 'client'], function () use ($router) {
$router->get('blabla[/{id}]', ['as' => 'findClient', 'uses' => 'ClientController@find']);
});
I think it's a bug. Have any of you guys faced this problem?
Please or to participate in this conversation.