Clockwork and Laravel

Clockwork is an awesome extension (and server-side component) for PHP development, written by itsgoingd. Not using Laravel? Don't worry, Clockwork also supports CodeIgniter, Monolog, Slim and Swift.

Consisting of a server-side component which can easily be installed from packagist using composer.

So what does clockwork actually do? It allows you to view lots of helpful information such as the timeline, raw database queries that are executed (very helpful if you're using a ORM) and session data.

Timeline

"Clockwork - Timeline"

Database View

"Clockwork - Database View"

Setting up Clockwork

  1. Add "itsgoingd/clockwork": "v1.5" to the require section of your composer.json
  2. If you're using the Laravel framework:
    1. Add 'Clockwork\Support\Laravel\ClockworkServiceProvider' to the providers array in app/config/app.php
    2. Run the following artisan command from the root of your project php artisan config:publish itsgoingd/clockwork --path vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/config/ (this will just copy the config file to app/config/itsgoingd/clockwork)
  3. Install the chrome extension
  4. Refresh the page

And there you go! Don't forget to ensure Clockwork isn't run on your production servers (the config file we published in step 2.2 might be helpful here).