File tree 1 file changed +33
-0
lines changed 1 file changed +33
-0
lines changed 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