In Lumen micro framework, i created a simple route with a date as parameter (ie: /2018-02-31).
$router->get(
'{from:\d{4}(?:-\d{1,2}){2}}',
[
'as' => 'date',
function($from) use ($router) {
return $from;
// return route('date',['from' => $from]);
}
]
);
If I return $from, it will return the date as 2018-02-31.
But, when i want to return is own route with the route() function, it returns /2018-02-31(?:-\d{1,2}){2}}
I tried with other regex for the date like [0-9]{4}-[0-9]{2}-[0-9]{2} and it doesn't work as well.