Open mtvbrianking opened 5 years ago
The array you're providing is not callable. A way to use an array of routes as a single callable is as the following:
$map->get('index', '/', new Dispatcher([
new SampleRouteMiddleware(),
'App\Http\Controllers\HomeController::index'
]));
As you can see, Dispatcher
implements also RequestHandlerInterface
so you can use it to group a list of callables in a single request handler instance.
I've managed to use the request-handler combined with aura-router with a single router handler.
Am trying to implement route specific middleware, as opposed to the 'global' application middleware.