From 53f211cf0a97752a1ceb97bc3f308f9b2d3fb050 Mon Sep 17 00:00:00 2001 From: Tim Van Dijck Date: Fri, 12 Apr 2024 15:04:28 +0200 Subject: [PATCH] Add Laravel 11 example for registring middleware. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index fd6c353..2c4b589 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,17 @@ return [ This packages provides a middleware which can be added as a global middleware or as a single route. + +* Laravel >= 11: * + +```php +->withMiddleware(function (Middleware $middleware) { + $middleware->append(\Spatie\HttpLogger\Middlewares\HttpLogger::class); +}) +``` + +* Laravel <= 10: * + ```php // in `app/Http/Kernel.php`