Skip to content

Commit

Permalink
Feature/updgrade to latest versions (#3)
Browse files Browse the repository at this point in the history
* Upgrade dependencies
  • Loading branch information
joskfg authored Jun 28, 2021
1 parent 712df34 commit 0b51b38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add `Softonic\Laravel\Middleware\RequestId::class` in `App\Http\Kernel`.
For all routes:
```php
protected $middleware = [
Softonic\Laravel\Middleware\RequestId::class,
\Softonic\Laravel\Middleware\RequestId::class,
....
]
```
Expand All @@ -26,7 +26,7 @@ Specific group:
// Example for WEB group
protected $middlewareGroups = [
'web' => [
Softonic\Laravel\Middleware\RequestId::class,
\Softonic\Laravel\Middleware\RequestId::class,
...
],

Expand All @@ -49,4 +49,9 @@ Register the middleware as a route middleware in `App\Http\Kernel`.
then, use it in your routes file, for example in `routes\web.php`
```php
Route::get('route', function() {})->middleware('request-id');
```
```

### Extra

If you need to have the X-Request-Id ASAP, you can modify `\App\Providers\AppServiceProvider::boot` adding `$_SERVER['HTTP_X_REQUEST_ID'] ??= \Ramsey\Uuid\Uuid::uuid4()->toString();`.
This is going to allow you to use the X-Request-ID in the framework booting to for example customize monolog or in console executions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"license": "Apache-2.0",
"type": "library",
"require": {
"php": ">=7.0",
"illuminate/http": "^5.3",
"ramsey/uuid": "^3.5"
"php": ">=7.4",
"illuminate/http": ">7.0",
"ramsey/uuid": "^4.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 0b51b38

Please sign in to comment.