php-crud-api icon indicating copy to clipboard operation
php-crud-api copied to clipboard

Add to Readme: the order in which middleware is defined matters

Open kkrell2016 opened this issue 2 years ago • 1 comments

This is a suggestion rather than a bug or problem.

The readme should point out that the order in which middleware is defined also controls the order in which it is executed. It is also possible to call a middleware more than once.

I don't know if this is intentional, but it cost me some nerves :) I struggled with sanitation and validation for example. But there are some great options as well.

I haven't tried it yet, but this way you could probably control the reconnect middleware better because you get more parameters in other handlers. There were some questions here about that.

So long story short, if its by intentional I think it should be mentioned in the docu as well.

kkrell2016 avatar Nov 30 '22 00:11 kkrell2016

Hi @kkrell2016, thank you for opening this issue.

The readme should point out that the order in which middleware is defined also controls the order in which it is executed.

Agree.

It is also possible to call a middleware more than once.

I would not recommend to do that.

So long story short, if its by intentional ...

Yes, it is intentional.

I think it should be mentioned in the docu as well.

Can you propose an addition to the documentation that makes this clear?

Kindest regards, Maurits

mevdschee avatar Nov 30 '22 06:11 mevdschee