File tree 2 files changed +36
-3
lines changed
2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 21
21
"require" : {
22
22
"php" : " >=8.1" ,
23
23
"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 " ,
27
27
"mobiledetect/mobiledetectlib" : " ~2.8" ,
28
28
"ua-parser/uap-php" : " ~3.9"
29
29
},
Original file line number Diff line number Diff line change @@ -46,6 +46,37 @@ The package uses the [auto registration feature](https://laravel.com/docs/5.8/pa
46
46
47
47
The middleware needs to be registered with the Kernel to allow it to parse the request.
48
48
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
+
49
80
Register the HTTP Stack Middleware for the web group in ` app/Http/Kernel.php ` :
50
81
51
82
``` php
@@ -66,6 +97,8 @@ Register the Route Middlewares in `app/Http/Kernel.php`:
66
97
'browser.block' => \Spinen\BrowserFilter\Route\BlockFilter::class,
67
98
```
68
99
100
+ ### Page to show if blocked
101
+
69
102
Build a page with a named route to redirect blocked browsers to:
70
103
71
104
``` php
You can’t perform that action at this time.
0 commit comments