Debug Component is commandline profiling package for Laravel, It was based from Laravel 4.1 commandline profiling tool which was merged with php artisan tail
.
Laravel | Debug |
---|---|
4.x.x | 2.x.x |
5.0.x | 3.0.x |
5.1.x | 3.1.x |
5.2.x | 3.2.x |
5.3.x | 3.3.x |
5.4.x | 3.4.x |
5.5.x | 3.5.x |
5.6.x | 3.6.x@dev |
To install through composer, simply put the following in your composer.json
file:
{
"require": {
"orchestra/debug": "~3.0"
}
}
And then run composer install
from the terminal.
Above installation can also be simplify by using the following command:
composer require "orchestra/debug=~3.0"
Add following service providers in config/app.php
.
'providers' => [
// ...
Orchestra\Debug\DebugServiceProvider::class,
Orchestra\Debug\CommandServiceProvider::class,
],
You could also create an alias for Orchestra\Support\Facades\Profiler
in config/app.php
.
'aliases' => [
// ...
'Profiler' => Orchestra\Support\Facades\Profiler::class,
],
To enable the profiler, all you need to do is:
Profiler::start();
This normally would goes in your development environment such as
local
environment, in the caseapp/Providers/AppServiceProvider.php
would be an ideal location to include the command.
To view the profiler, run the following command in your terminal:
php artisan debug