Skip to content

janusnic/clockwork-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clockwork integration plugin

This plugin adds Clockwork Developer Tools integration plugin for OctoberCMS.

Clockwork comes with a facade, which provides an easy way to add records to the Clockwork log and events to the timeline. You can use alias:

use Clockwork\Support\Laravel\Facade as Clockwork

Now you can use the following commands:

Clockwork::startEvent('event_name', 'Event description.'); // event called 'Event description.' appears in Clockwork timeline tab

Clockwork::info('Message text.'); // 'Message text.' appears in Clockwork log tab
Log::info('Message text.'); // 'Message text.' appears in Clockwork log tab as well as application log file

Clockwork::info(array('hello' => 'world')); // logs json representation of the array
Clockwork::info(new Object()); // logs string representation of the objects if the object implements __toString magic method, logs json representation of output of toArray method if the object implements it, if neither is the case, logs json representation of the object cast to array

Clockwork::endEvent('event_name');

Also you can use functions inside a Twig template

{{ info(var) }} // appears in Clockwork log tab
{{ startEvent('event_name', 'Event description.') }} // event called 'Event description.' appears in Clockwork timeline tab
{{ endEvent('event_name') }}

About

Clockwork integration plugin for OctoberCMS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%