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-01-29 03:03:50 |
Package Statistics | |
---|---|
Total Downloads: | 847,656 |
Monthly Downloads: | 11,309 |
Daily Downloads: | 478 |
Total Stars: | 63 |
Total Watchers: | 5 |
Total Forks: | 11 |
Total Open Issues: | 0 |
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="