diff --git a/developer_manual/basics/middlewares.rst b/developer_manual/basics/middlewares.rst index f690776ff3c..106337fce4a 100644 --- a/developer_manual/basics/middlewares.rst +++ b/developer_manual/basics/middlewares.rst @@ -66,6 +66,43 @@ The middleware can be registered in the app's ``Application`` class: } +Global Middlewares +------------------ + +.. versionadded:: 26 + +Registered middlewares will only intercept requests of the same app by default. To make a middleware *global* and trigger for other apps' middlewares, add `true` as second argument of the ``registerMiddleware`` call: + +.. code-block:: php + :caption: lib/AppInfo/Application.php + :emphasize-lines: 20 + + registerMiddleware(MonitoringMiddleware::class, true); + } + + public function boot(IBootContext $context): void {} + + } + Dependency Injection Container Registration -------------------------------------------