Excuse me for my poor English.
Can Slim4 middleware not set before / after for group?
$app->group('/users/', function (RouteCollectorProxy $group) {
// OK afterfilter
$group->any('{id:[0-9]+}/','RouteClass')->add(new Middleware());
// NG
$group->add(new Middleware())->any('{id:[0-9]+}/','RouteClass');
});
This sample assumes middleware that is added if there is no “/” at the end of the user ID.
However, it seems that only the Before filter can be attached.