From 3f2fe851b09d108a9379d9c7f9f8cbba7ec24a0f Mon Sep 17 00:00:00 2001 From: HamzahMadni <118311611+HamzahMadni@users.noreply.github.com> Date: Tue, 24 Dec 2024 00:11:11 +0000 Subject: [PATCH] Add L11 global middleware syntax. (#201) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d36be1b..35823b6 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,16 @@ This will copy the `index` and `dialogContents` view files over to `resources/vi Instead of including `cookie-consent::index` in your view you could opt to add the `Spatie\CookieConsent\CookieConsentMiddleware` to your kernel: +In Laravel 11 open /bootstrap/app.php and register them there: + +```php + ->withMiddleware(function (Middleware $middleware) { + $middleware->append(\Spatie\CookieConsent\CookieConsentMiddleware::class); + }) +``` + +In Laravel 9 and 10 you can add them in app/Http/Kernel.php: + ```php // app/Http/Kernel.php