Next Generation PHP Profiler for Laravel
This project is no longer maintained and I won't provide support for it.
Add this dependency to
composer.json with this command:
composer require-dev onigoetz/profiler:dev-master
And add this in your
configuration/app.php file. This will allow the Profiler to only load locally and will not clutter your production build.
'providers' => array( 'Onigoetz\Profiler\Support\Laravel\ProfilerServiceProvider', ... ), 'aliases' => array( ... 'Stopwatch' => 'Onigoetz\Profiler\Stopwatch' ... )
By default, the profiler will run only in environment that are not "production"
You can override all default values by doing
./artisan config:publish onigoetz/profiler and editing the
environmentsAn array of environments on which the profiler may be shown
assets_autoIf set to true (default) it will include its assets itself, you can disable this to add the assets to your own build process
panelsAn array of classes that extend
Onigoetz\Profiler\Panelyou can add your own panels and reorder them.
slow_queryThreshold in milliseconds after which it is considered slow
All panels are work in progress for the moment, many changes may happen
This panel provides a way to watch for events in a graphical way.
You can profile anything anywhere in your code by using the
It's a facade for a stopwatch heavily inspired from Stopwatch Symfony component, the difference is that mine doesn't support sections As any Laravel Facade you don't have to initialize it, just use it
Stopwatch::start('stuff to benchmark'); //do your stuff Stopwatch::stop('stuff to benchmark');
Provide a list of executed queries and their bindings. Also checks for duplicated queries, based on raw SQL without bindings, small but useful tool to track down which query could be improved
List of declared routes with some more informations ( route name, filter, hostname, action …) Also highlights the current route.
(The same informations as the
./artisan routes + highlighted current route)
Registers a new log handler to output the logs from the current run
List of loaded files and their size
A list of useful bookmarklets + loaded scripts on the current page
Each panel is a class that has some methods to do it's stuff
$dataAll data must be stored here, so we can serialize the class easily
App::before()here you can register some classes or events
getData()retrieve the data and store in
getName()return a string with the name, will be used as an id and class in HTML
Viewwith the rendered panel
PanelTitleobject with the title properties