PHP code example of gpn273 / laravel-psr18-http-bridge

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

    

gpn273 / laravel-psr18-http-bridge example snippets


use Gpn273\LaravelPsr18HttpBridge\Psr18Client;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Facades\Http;

$client = new Psr18Client(function (): PendingRequest {
    return Http::timeout(10)
        ->connectTimeout(3)
        ->acceptJson();
});