- Can I use playbloom/guzzle-bundle in a Laravel application?
- No, not directly. Playbloom GuzzleBundle is a Symfony2 bundle that depends on Symfony bundle registration, the DI container, and the Symfony profiler lifecycle, none of which exist in Laravel's service provider and middleware model. Laravel developers should treat it as a reference implementation for Guzzle profiling middleware rather than a Composer dependency. Attempting to install it in a Laravel project will likely produce dependency conflicts and missing profiler services.
- What does playbloom/guzzle-bundle actually do?
- It integrates Guzzle into Symfony with configurable clients, service wiring, logging, and a web profiler panel that shows outgoing HTTP requests. The data collector records details such as the request URI, method, status, and timing so you can inspect API calls during development. The value for Laravel users is the profiling concept, not the Symfony-specific bundle layer.
- How do I debug Guzzle HTTP requests in Laravel?
- Use Laravel-native tooling first: Laravel Debugbar, Telescope, or Clockwork can capture outgoing HTTP client activity when paired with a small Guzzle middleware. Register the middleware on your Guzzle client stack so it records method, URI, status, duration, and selected headers. Keep the collector scoped to the local environment so it never runs in production.
- Does playbloom/guzzle-bundle support Guzzle 7 and modern PHP versions?
- That is unlikely and should be treated as risky. The bundle is Symfony2-era code with older Guzzle constraints, low adoption, and zero dependents, so compatibility with Guzzle 7.x and PHP 8 is unverified. If you need Guzzle 7 support, plan on writing or forking minimal middleware rather than installing the bundle.
- How do I log outgoing Guzzle requests and responses in Laravel with middleware?
- Create a Guzzle middleware that taps the handler stack and captures the request before it is sent and the response after it returns. Push it onto the client's handler stack through Guzzle's HandlerStack::push or middleware configuration. From there you can forward the collected data to Debugbar, Telescope, or a custom dev-only collector, and you control exactly which fields get recorded.
- What Laravel alternatives exist to a Symfony Guzzle profiler?
- Laravel Debugbar, Laravel Telescope, and Clockwork are the common choices for request and HTTP client visibility. Telescope and Clockwork both support Guzzle instrumentation through middleware, which covers most of what the Symfony bundle's profiler panel offers. For lightweight needs, a custom middleware that writes to the log or a debug collector is often enough.
- Is it safe to run a Guzzle profiler in production?
- No. Profiling stores request and response data, which grows memory usage and log volume and can leak credentials or personal data. Restrict the middleware and collector to local and staging environments, cap the number of retained entries, and sample requests if volume is high. Always disable the profiler in production.
- How do I redact sensitive headers and bodies from logged HTTP requests?
- Implement redaction inside your middleware before the data reaches the collector or log. Strip or mask Authorization, Cookie, and API key headers, and avoid storing full request or response bodies unless you explicitly need them. A whitelist approach that records only method, URI, status, duration, and safe headers is the simplest way to stay safe.
- Is playbloom/guzzle-bundle still maintained?
- It shows the signs of a stale, low-adoption package: Symfony2-era assumptions, low stars, zero dependents, and no commercial support. The MIT license allows forking, but there is no warranty and no active community to fall back on. Treat it as a conceptual reference and keep ownership of any profiling code inside your own application.
- Can I fork playbloom/guzzle-bundle and port it to Laravel?
- You can under the MIT license, but porting the whole bundle is not worth the effort. Extract only the Guzzle middleware and data-collection logic, then wire it into a Laravel service provider and Debugbar or Telescope. Skip the Symfony bundle registration, DI configuration, and profiler templates entirely, and validate the result against your target Laravel and Guzzle 7.x versions.