Skip to content

Commit

Permalink
Merge pull request #44 from spinen/feature/supportL11
Browse files Browse the repository at this point in the history
support l11
  • Loading branch information
jimmypuckett authored Apr 8, 2024
2 parents 687e618 + fa990c5 commit 64b3277
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"require": {
"php": ">=8.1",
"ext-json": "*",
"illuminate/cache": "^9.19|^10",
"illuminate/routing": "^9.19|^10",
"illuminate/support": "^9.42|^10",
"illuminate/cache": "^9.19|^10|^11",
"illuminate/routing": "^9.19|^10|^11",
"illuminate/support": "^9.42|^10|^11",
"mobiledetect/mobiledetectlib": "~2.8",
"ua-parser/uap-php": "~3.9"
},
Expand Down
33 changes: 33 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,37 @@ The package uses the [auto registration feature](https://laravel.com/docs/5.8/pa

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

### Laravel 11 & newer

Register the HTTP Stack Middleware for the web group in `bootstrap/app.php`:

```php
->withMiddleware(function (Middleware $middleware) {
// ...
$middleware->web(append: [
// ...
\Spinen\BrowserFilter\Stack\Filter::class,
]);
// ...
})
```

Register the Route Middlewares in `bootstrap/app.php`:

```php
->withMiddleware(function (Middleware $middleware) {
// ...
$middleware->alias([
// ...
'browser.allow' => \Spinen\BrowserFilter\Route\AllowFilter::class,
'browser.block' => \Spinen\BrowserFilter\Route\BlockFilter::class,
]);
// ...
})
```

### Before Laravel 11

Register the HTTP Stack Middleware for the web group in `app/Http/Kernel.php`:

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

### Page to show if blocked

Build a page with a named route to redirect blocked browsers to:

```php
Expand Down

0 comments on commit 64b3277

Please sign in to comment.