Looking to hire Laravel developers? Try LaraJobs

laravel-debugbar maintained by jaguarsoft

Description
Handle Debugbar Enabling by Middleware
Author
Last update
2022/11/24 05:58 (dev-master)
License
Links
Downloads
417

Comments
comments powered by Disqus

Laravel Debugbar Extension

This package allows you to enable the Debugbar on deman, despite being disabled by configuration.

Installation

composer require jaguarsoft/laravel-debugbar

Configuration

config/app.php

'providers' => [   
    /** **/ 
    // Barryvdh\Debugbar\ServiceProvider::class,
    JaguarSoft\LaravelDebugbar\Provider\DebugbarServiceProvider::class,
],
'aliases' => [
    /** **/
    'Debugbar' => Barryvdh\Debugbar\Facade::class,
],

Use

To load Enabled for All

DEBUGBAR_ENABLED=true

To load Disable for All, enabled after in a Middleware

DEBUGBAR_ENABLED=false

To load Enabled when APP_DEBUG=true

DEBUGBAR_ENABLED=null

Middleware

public function handle($request, Closure $next){
    if(/* your validation*/){
        \Debugbar::enable();
    }
    return $next($request);
}

Example Middleware: https://gist.github.com/laurenceHR/911050c675eb5a1d28b761b61b3b25a0

Used and Tested in Laravel 5.2, 5.3, 5.4 Is not necessary in Laravel 5.5 because with "barryvdh/laravel-debugbar" version "~3.4.2" has this feature included.