2017 © Pedro Peláez
 

library laravel-guzzle-provider

Guzzle Service Provider for Laravel 6

image

kozz/laravel-guzzle-provider

Guzzle Service Provider for Laravel 6

  • Thursday, June 21, 2018
  • by urakozz
  • Repository
  • 4 Watchers
  • 47 Stars
  • 113,818 Installations
  • PHP
  • 3 Dependents
  • 1 Suggesters
  • 14 Forks
  • 0 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

Laravel - Guzzle 6 (or 5) Service Provider

Downloads Packagist Version, (*1)

laravel guzzle service provider, (*2)

Install With Composer:

Guzzle ~5.0

composer require kozz/laravel-guzzle-provider ~5.0

Or manualy in composer.json:, (*3)

"require": {
    "kozz/laravel-guzzle-provider": "~5.0"
}

Guzzle ~6.0

composer require kozz/laravel-guzzle-provider ~6.0

Or manualy in composer.json:, (*4)

"require": {
    "kozz/laravel-guzzle-provider": "~6.0"
}

Setup

Laravel >=5.5

This package supports auto discovery, so no configuration is required., (*5)

Laravel <5.5

Register Service Provider

/configs/app.php, (*6)

    ...
    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        ...

        /*
         * Application Service Providers...
         */
        ...
        'Kozz\Laravel\Providers\Guzzle'
    ],

Enable Facade

/configs/app.php, (*7)

    ...
    'aliases' => [
        ...
        'Guzzle' => 'Kozz\Laravel\Facades\Guzzle'
    ],

Usage

Send request


$response = \Guzzle::get('https://google.com');

Get instance

    $client = app()->offsetGet('guzzle');
    $client = \Illuminate\Container\Container::getInstance()->offsetGet('guzzle');
    $client = \Kozz\Laravel\Facades\Guzzle::getFacadeRoot();
    $client = \Guzzle::getFacadeRoot();

POST

$response = Guzzle::post(
    'https://httpbin.org/post',
    [
        'form_params' => [
            'id' => 222
        ]
    ]
);

Basic auth

$response = Guzzle::post(
    'https://httpbin.org/post',
    [
        'auth' => [ 'theUsername', 'thePassword'],
    ]
);

generates: +"Authorization": "Basic dGhlVXNlcm5hbWU6dGhlUGFzc3dvcmQ=", (*8)

The Versions

21/06 2018

dev-master

9999999-dev

Guzzle Service Provider for Laravel 6

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle

20/06 2018

6.1.0

6.1.0.0

Guzzle Service Provider for Laravel 6

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle

03/06 2015

6.0

6.0.0.0

Guzzle Service Provider for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle

16/04 2015

5.0

5.0.0.0

Guzzle Service Provider for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle

16/04 2015

1.0.1

1.0.1.0

Guzzle Service Provider for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle

06/08 2014

v0.0.1

0.0.1.0

laravel guzzle service provider

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hongbo Tang

laravel http guzzle