How to register middlewareGroups in October's Plugin?
Opened this issue · 4 comments
Hi,
I have read the October CMS doc's found here: https://octobercms.com/docs/plugin/registration#registering-middleware
However, it does not mention how we can setup middleware groups. For example, I would like to convert the following code to register it in one of my plugins:
protected $middlewareGroups = [
'web' => [
...
],
'api' => [
...
],
'firewall' => [
\PragmaRX\Firewall\Middleware\FirewallBlacklist::class,
\PragmaRX\Firewall\Middleware\BlockAttacks::class,
],
];
Note: The firewall registered middleware group.
Firstly, how can I set that in an October CMS Plugin under the:
public function boot()
{
// ..
}
Secondary, when I get an answer to this I would like to add it to the doc's webpage in the above link to help others.
@ayumihamsaki why'd you close this?
@LukeTowers The only reason I closed this was because of no answer to this issue for a long period of time and I was going through all my Github Issues and clearing things up.
I am happy to keep this issue open and hope a solution can get added to the doc's in the near future.
We can leave it open for now. At some point someone might take care of it.
Only way to define group middlewares is to change it in Kernel.
https://github.com/octobercms/library/blob/develop/src/Foundation/Http/Kernel.php#L52