Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmypuckett committed Apr 8, 2024
2 parents 527ad2e + c7dcbdc commit 054afa1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.2.0
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 054afa1

Please sign in to comment.