I have a list of routes, some are using parameters and everything is working correctly. My problem happen when I try to constrain the parameter (to check the it is valid before executing my controller).
Following the documentation I did it this way :
$router->group(['middleware' => 'auth:api'], function () use ($router) {
$router->get('/user/{userId:[a-z0-9]+}', 'UserController@userByUserIdGet');
});
But all I receive is a NotFoundHttpException meaning that it doesn't match my route.
I can't see where my mistake is. Any idea?
Thank you.