laravel debug code example

Example 1: laravel debug bar

composer require barryvdh/laravel-debugbar --dev

Example 2: laravel debugbar

composer require barryvdh/laravel-debugbar --dev
  
// config/app.php
// ServiceProviders
Barryvdh\Debugbar\ServiceProvider::class,
// Facades
'Debugbar' => Barryvdh\Debugbar\Facade::class,


php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

Example 3: laravel debug

composer require barryvdh/laravel-debugbar --dev
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

Example 4: debug bar laravel print array

Debugbar::info($object);
Debugbar::error('Error!');
Debugbar::warning('Watch out…');
Debugbar::addMessage('Another message', 'mylabel');

Example 5: debugger in laravel

Barryvdh\Debugbar\ServiceProvider::class,

Example 6: debugger in laravel

Debugbar::startMeasure('render','Time for rendering');
Debugbar::stopMeasure('render');
Debugbar::addMeasure('now', LARAVEL_START, microtime(true));
Debugbar::measure('My long operation', function() {
    // Do something…
});

Tags:

Misc Example