Using Clockwork for debugging in Chrome Developer tools

Submitted by msurguy - 11 years ago

What if instead of using debugging bar like https://github.com/barryvdh/laravel-debugbar or others, you could use something that integrates directly with Chrome's web developer tools? Imaging viewing request information, headers, get and post data, cookies, session data, DB queries, routes and timing, all within Chrome's developer tools panel? With this extension, you can! Read the instructions below to know how!

/***

1) Install the Chrome extension from https://chrome.google.com/webstore/detail/clockwork/dmggabnehkmmfmdffgajcflpdjlnoemp

2) In your Laravel project, install this package using Composer : "itsgoingd/clockwork": "dev-master"

3) Add the service provider:
'providers' => array(
    ...
    'Clockwork\Support\Laravel\ClockworkServiceProvider'
)

4) Publish the package's settings using Artisan command:
$ php artisan config:publish itsgoingd/clockwork --path vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/config/

5) Add this to your Base controller's constructor:

$this->beforeFilter(function()
{
    Event::fire('clockwork.controller.start');
});

$this->afterFilter(function()
{
    Event::fire('clockwork.controller.end');
});

6) That's it! Now when your application executes, you should be able to see info from the application in the web developer tools!

7) If you need more info, consult with package readme at : https://github.com/itsgoingd/clockwork

***/