Illuminate\Support\Facades\Http) already provides similar functionality, raising questions about added value.Http client? What unique problems does this bundle solve that Http::get()/Http::post() doesn’t?config/cache or environment variables?services.rest_client), enabling dependency injection.config() system for API endpoints, headers, and defaults.ApiRequestStarted, ApiResponseReceived) for cross-cutting concerns (logging, analytics).Http client.Http::withOptions().HttpClient, ensure the project’s Symfony components are up-to-date to avoid version skew.composer.json:
"brunopicci/services-bundle": "^dev-main"
php artisan vendor:publish.AppServiceProvider):
$this->app->bind('restClient', function ($app) {
return new \Brunopicci\ServicesBundle\Service\RestClient();
});
// Before
$response = Http::get('https://api.example.com/data');
// After
$client = app('restClient');
$response = $client->call('GET', 'https://api.example.com/data');
$client->setLogger(app(\Psr\Log\LoggerInterface::class));
Http client for critical paths.Http::withOptions(['timeout' => 5]) if the bundle lacks config options.Http::retry() or implement a custom decorator:
$client->call('GET', $url, ['retry' => 3]);
config/services.php).How can I help you explore Laravel packages today?