PHP code example of alitindrawan24 / laravel-request-id

1. Go to this page and download the library: Download alitindrawan24/laravel-request-id library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alitindrawan24 / laravel-request-id example snippets


// in `app/Http/Kernel.php`

protected $middleware = [
    // ...
    
    \Alitindrawan24\RequestID\Middleware\RequestIDMiddleware::class
];

// in a routes file

Route::post('/dashboard', function () {
    //
})->middleware(\Alitindrawan24\RequestID\Middleware\RequestIDMiddleware::class);
bash
php artisan vendor:publish --provider="Alitindrawan24\RequestID\RequestIDServiceProvider" --tag="config"