README

Guzzle Subscriber for logging to clockwork so you can view the requests timeline and logs in your browser's developer tools.

Usage

// First you need a Guzzle HTTP Client
$client = new GuzzleHttp\Client;
// Then you need a Clockwork object
$clockwork = new Clockwork\Clockwork;
// Create the Guzzle subscriber
$subscriber = new GuzzleHttp\Subscriber\Log\ClockworkSubscriber($clockwork);
// Add it as a subscriber
$client->getEmitter()->attach($subscriber);

And you are done!

Laravel 4

If you are using Laravel 4, use the included service providers to add
the subscriber to every Guzzle Client.

Be sure to create every client via the auto-resolving application container:

$client = App::make('GuzzleHttp\Client');

Guzzle v3

If you want to continue to work with the old Guzzle v3 (Guzzle\Http\Client instead of GuzzleHttp\Client) ClockworkPlugin
then you might want to install the 0.1.* releases. Pull request with Guzzle v3 compatibility should be made against the guzzle3branch. Install the latest guzzle v3 compatible version with 0.1.* or dev-guzzle3.

Versions 0.2.0 and up are all compatible with Guzzle v4 and v5.

Contributing

Feel free to make a pull request. Please try to be as
PSR-2
compliant as possible.