2017 © Pedro Peláez
 

library laravel-middleware-request-id

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

image

softonic/laravel-middleware-request-id

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

  • Wednesday, February 8, 2017
  • by Joskfg
  • Repository
  • 9 Watchers
  • 7 Stars
  • 5,758 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 43 % Grown

The README.md

softonic/laravel-middleware-request-id

Build Status, (*1)

Install

$ composer require softonic/laravel-middleware-request-id

Usage

For all routes or a specific group

Add Softonic\Laravel\Middleware\RequestId::class in App\Http\Kernel., (*2)

For all routes:, (*3)

protected $middleware = [
    \Softonic\Laravel\Middleware\RequestId::class,
    ....
]

Specific group:, (*4)

// Example for WEB group
protected $middlewareGroups = [
        'web' => [
            \Softonic\Laravel\Middleware\RequestId::class,
            ...
        ],

        'api' => [
            ...
        ],
    ];

For a specific route

Register the middleware as a route middleware in App\Http\Kernel., (*5)

    protected $routeMiddleware = [
        ...
        'request-id' => Softonic\Laravel\Middleware\RequestId::class,
    ];

then, use it in your routes file, for example in routes\web.php, (*6)

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., (*7)

The Versions

08/02 2017

dev-master

9999999-dev

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Jose Manuel Cardona

laravel middleware tracking

08/02 2017

v1.0.1

1.0.1.0

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Jose Manuel Cardona

laravel middleware tracking

08/02 2017

v1.0.0

1.0.0.0

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Jose Manuel Cardona

laravel middleware tracking