Skip to content

Commit 64b3277

Browse files
authored
Merge pull request #44 from spinen/feature/supportL11
support l11
2 parents 687e618 + fa990c5 commit 64b3277

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"require": {
2222
"php": ">=8.1",
2323
"ext-json": "*",
24-
"illuminate/cache": "^9.19|^10",
25-
"illuminate/routing": "^9.19|^10",
26-
"illuminate/support": "^9.42|^10",
24+
"illuminate/cache": "^9.19|^10|^11",
25+
"illuminate/routing": "^9.19|^10|^11",
26+
"illuminate/support": "^9.42|^10|^11",
2727
"mobiledetect/mobiledetectlib": "~2.8",
2828
"ua-parser/uap-php": "~3.9"
2929
},

readme.md

+33
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,37 @@ The package uses the [auto registration feature](https://laravel.com/docs/5.8/pa
4646

4747
The middleware needs to be registered with the Kernel to allow it to parse the request.
4848

49+
### Laravel 11 & newer
50+
51+
Register the HTTP Stack Middleware for the web group in `bootstrap/app.php`:
52+
53+
```php
54+
->withMiddleware(function (Middleware $middleware) {
55+
// ...
56+
$middleware->web(append: [
57+
// ...
58+
\Spinen\BrowserFilter\Stack\Filter::class,
59+
]);
60+
// ...
61+
})
62+
```
63+
64+
Register the Route Middlewares in `bootstrap/app.php`:
65+
66+
```php
67+
->withMiddleware(function (Middleware $middleware) {
68+
// ...
69+
$middleware->alias([
70+
// ...
71+
'browser.allow' => \Spinen\BrowserFilter\Route\AllowFilter::class,
72+
'browser.block' => \Spinen\BrowserFilter\Route\BlockFilter::class,
73+
]);
74+
// ...
75+
})
76+
```
77+
78+
### Before Laravel 11
79+
4980
Register the HTTP Stack Middleware for the web group in `app/Http/Kernel.php`:
5081

5182
```php
@@ -66,6 +97,8 @@ Register the Route Middlewares in `app/Http/Kernel.php`:
6697
'browser.block' => \Spinen\BrowserFilter\Route\BlockFilter::class,
6798
```
6899

100+
### Page to show if blocked
101+
69102
Build a page with a named route to redirect blocked browsers to:
70103

71104
```php

0 commit comments

Comments
 (0)