Aug 24, 2021
0
Level 3
Regular Expression Constraints - Routing Lumen
I don't understand the following:
$router->get('team/{id:[A-Za-z]+}', ['uses' => 'TeamController@show']);
When I call the URL /team/123 I get a 405 response as answer. If I change the route to:
$router->get('team/{id:[0-9]+}', ['uses' => 'TeamController@show']);
and call /team/abc i get a 404 Error. I would also like to have a 405 response for letters.
What am I doing wrong?
Please or to participate in this conversation.