New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

sanchescom/laravel-guzzle

Guzzle facade for laravel.
1,994 1
Install
composer require sanchescom/laravel-guzzle
Latest Version:0.1.0
PHP:~5.6|~7.0
Laravel:5
License:MIT
Last Updated:Aug 26, 2019
Links: GitHub  ·  Packagist
Maintainer: sanchescom

Laravel guzzle

A Laravel facade for GuzzleHttp Client.

Installing

Require this package, with Composer, in the root directory of your project.

$ composer require sanchescom/laravel-guzzle

Laravel 5.x:

After updating composer, add the ServiceProvider to the providers array in config/app.php

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

Lumen:

After updating composer add the following lines to register provider in bootstrap/app.php

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

Usage

GET Status code
<?php

use Sanchescom\Guzzle\Facades\Guzzle;

/**
 * $statusCode = int(200)
 */
$statusCode = Guzzle::get('https://some.thing')->getStatusCode();
POST with custom config
<?php

use Sanchescom\Guzzle\Facades\Guzzle;

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

$data = [
    "email" => "some@thing.new",  
];

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

Related Packages

spondonit/zttp

A developer-experience focused HTTP client, optimized for most common use cases.

6,359 0
kozz/laravel-guzzle-provider

Guzzle 5/6 Service Provider for Laravel

1,111,401 62
eleme/laravel-guzzle

laravel guzzle service provider

6,607 6
utkarshx/laravel-guzzle-provider

Guzzle Service Provider for Laravel 6

8 0
webwhales/laravel-guzzle-conditional-mock-handler

Offers a way to load mocked responses conditionally with Guzzle instead of a fix...

30,548 7

Version History

Version Released PHP Laravel License
0.1.0 ~5.6|~7.0 ~5.0 MIT
0.0.1 ~5.6|~7.0 ~5.0 MIT