Skip to content

Passing parameters to middlewares #704

@michaelthedev

Description

@michaelthedev

Hi
I've looked through the documentation and other issues raised here and I can't find any working way to pass parameters to middleware

I'm looking to achieve something like this

Router::group( ['middleware' => ['limiter,1,2'] ], function () {});

or this

Router::post('/path-here', [Controller::class, 'method'])
    ->addMiddleware(Limiter::class, 'paramter1', 'parameter2');

// or 
Router::post('/path-here', [Controller::class, 'method'])
    ->addMiddleware(Limiter::class, ['paramter1', 'parameter2']);

I'm available to assist on this if needed. Thanks and Happy New Year

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions