boson-php/http
Lightweight HTTP client utilities for PHP. Provides simple request/response handling with a focus on clear, minimal APIs suitable for small services, scripts, and internal tools. Designed to keep dependencies low while staying easy to extend and integrate.
boson-php/boson), which could fit into a Laravel application as a replacement or supplement to Guzzle or Symfony’s HTTP client. It may align well with:
Illuminate\Pipeline) may not align with Boson’s middleware design, requiring custom bridges.HttpTests) could complicate CI/CD pipelines.App\Exceptions\Handler).boson-php/laravel-http).withHeaders(), throwIf())?get(), post())?Cache::remember) for HTTP responses?// Example: boson-php/http → Laravel facade
facade(BosonHttp::class, function () {
return new BosonHttpClient(config('boson.http'));
});
Handle interface:
class BosonMiddleware implements Middleware
{
public function handle($request, Closure $next) {
// Transform Laravel Request to Boson format
$bosonRequest = BosonRequest::fromGlobals();
$response = $next($bosonRequest);
return new LaravelResponse($response);
}
}
Mockery or Laravel’s HttpTestCase.illuminate/http (v9+).symfony/http-client (if used).grpc, protobuf).| Phase | Task | Risk Mitigation |
|---|---|---|
| Discovery | Audit current HTTP usage (Guzzle/Symfony calls). | Document all entry points. |
| Proof of Concept | Replace a single API call; test error handling. | Roll back if debugging is cumbersome. |
| Adapter Dev | Build facade/middleware layer. | Use interfaces for loose coupling. |
| Performance Test | Benchmark vs. Guzzle in production-like load. | Set baseline metrics first. |
| Full Rollout | Replace all HTTP clients; update CI/CD. | Phase by feature/module. |
telescope drivers or laravel-debugbar support.| Scenario | Impact | Mitigation |
|---|---|---|
| Boson HTTP client crashes | API timeouts, 5xx errors | Circuit breakers (e.g., spatie/fork). |
| Protobuf/gRPC dependency fails | Runtime errors (e.g., extension missing) |
Container health checks (Docker/K8s). |
| Middleware conflicts | Silent request failures | Feature flags for gradual rollout. |
| No Laravel-specific monitoring | Blind spots in error tracking | Custom Monolog handlers. |
HttpException).BosonHttp::get('/api')).How can I help you explore Laravel packages today?