PHP code example of vmorozov / laravel-http-client-requests-logger

1. Go to this page and download the library: Download vmorozov/laravel-http-client-requests-logger 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/ */

    

vmorozov / laravel-http-client-requests-logger example snippets


use \VMorozov\LaravelHttpClientRequestsLogger\HttpClientRequestsLogger;

// .....

public function __construct(private HttpClientRequestsLogger $requestsLogger)
{
    $this->requestsLogger->setApiName('some api name');
}

Http::withMiddleware($this->requestsLogger->createLoggingMiddleware());