PHP code example of swisnl / laravel-psr-http-client-bridge

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

    

swisnl / laravel-psr-http-client-bridge example snippets

 php
$httpClient = new Swis\Laravel\Bridge\PsrHttpClient\Client();
$client = new My\Awesome\Api\Client($httpClient);
 php
$httpClient = new Swis\Laravel\Bridge\PsrHttpClient\Client(
    fn () => Http::withOptions(['proxy' => 'http://localhost:8125'])
);