Hello
I worked on some modules via laminas MVC and Middleware, I needed some parameters like validator
name for request or permission
for each handler to manage RBAC and same.
I put all of them in route default options and have access and use them in Middleware and handler. like this example
'child_routes' => [
'login' => [
'type' => Literal::class,
'options' => [
'route' => '/login',
'defaults' => [
'module' => 'user',
'section' => 'api',
'package' => 'profile',
'handler' => 'login',
'permissions' => 'user_login',
'validation' => 'login',
'controller' => PipeSpec::class,
'middleware' => new PipeSpec(
Middleware\SecurityMiddleware::class,
Middleware\ValidationMiddleware::class,
Handler\Api\LoginHandler::class
),
],
],
],
],
Is true? or better I should use another way?
thanks