Skip to content

Commit 2af4770

Browse files
authored
docs: added instructions for v12
Updated instructions for adding middleware to the application.
1 parent 11c99e3 commit 2af4770

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ You can install the package via composer:
2323
composer require chinleung/laravel-multilingual-routes
2424
```
2525

26-
To detect and change the locale of the application based on the request automatically, you can add the middleware to your `app/Http/Kernel`. It must be the first item in the `web` middleware group.
26+
To detect and change the locale of the application based on the request automatically, you can add the middleware to your `bootstrap/app.php`. It must be the first item in the `web` middleware group.
2727

2828
``` php
29-
protected $middlewareGroups = [
30-
'web' => [
31-
\ChinLeung\MultilingualRoutes\DetectRequestLocale::class,
32-
// ...
29+
$middleware->web(
30+
prepend: [
31+
DetectRequestLocale::class,
3332
]
34-
];
33+
);
3534
```
3635

3736
## Configuration

0 commit comments

Comments
 (0)