| Package Data | |
|---|---|
| Maintainer Username: | urakozz |
| Maintainer Contact: | thbourlove@gmail.com (Hongbo Tang) |
| Package Create Date: | 2015-04-16 |
| Package Last Update: | 2024-03-04 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-02 15:18:45 |
| Package Statistics | |
|---|---|
| Total Downloads: | 966,235 |
| Monthly Downloads: | 23,309 |
| Daily Downloads: | 51 |
| Total Stars: | 62 |
| Total Watchers: | 4 |
| Total Forks: | 11 |
| Total Open Issues: | 1 |
laravel guzzle service provider
composer require kozz/laravel-guzzle-provider ~5.0
Or manualy in composer.json:
"require": {
"kozz/laravel-guzzle-provider": "~5.0"
}
composer require kozz/laravel-guzzle-provider ~6.0
Or manualy in composer.json:
"require": {
"kozz/laravel-guzzle-provider": "~6.0"
}
This package supports auto discovery, so no configuration is required.
/configs/app.php
...
'providers' => [
/*
* Laravel Framework Service Providers...
*/
...
/*
* Application Service Providers...
*/
...
'Kozz\Laravel\Providers\Guzzle'
],
/configs/app.php
...
'aliases' => [
...
'Guzzle' => 'Kozz\Laravel\Facades\Guzzle'
],
$response = \Guzzle::get('https://google.com');
$client = app()->offsetGet('guzzle');
$client = \Illuminate\Container\Container::getInstance()->offsetGet('guzzle');
$client = \Kozz\Laravel\Facades\Guzzle::getFacadeRoot();
$client = \Guzzle::getFacadeRoot();
$response = Guzzle::post(
'https://httpbin.org/post',
[
'form_params' => [
'id' => 222
]
]
);
$response = Guzzle::post(
'https://httpbin.org/post',
[
'auth' => [ 'theUsername', 'thePassword'],
]
);
generates:
+"Authorization": "Basic dGhlVXNlcm5hbWU6dGhlUGFzc3dvcmQ="