PHP code example of sanchescom / laravel-guzzle

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

    

sanchescom / laravel-guzzle example snippets


'providers' => [
    ...
    Sanchescom\Guzzle\Providers\GuzzleServiceProvider::class,
],

$app->register(Sanchescom\Guzzle\Providers\GuzzleServiceProvider::class);



use Sanchescom\Guzzle\Facades\Guzzle;

/**
 * $statusCode = int(200)
 */
$statusCode = Guzzle::get('https://some.thing')->getStatusCode();



use Sanchescom\Guzzle\Facades\Guzzle;

$config = [
    "base_uri" => "https://some.thing.new",
];

$data = [
    "email" => "[email protected]",  
];

/**
 * $statusCode = int(201)
 */
$statusCode = Guzzle::config($config)->post('users', $data)->getStatusCode();