This is my routes.php
:
$app->get('/users/{id}/', ['middleware' => 'example', function () {
return "users";
}]);
This is the handle
function in the middleware:
public function handle($request, Closure $next)
{
// I would like to get the value of the url parameter {id} here
return $next($request);
}
Is there a way I can get the parameter id
from my middleware?
* Edit *
I'm using Lumen 5.1.0.