Skip to content

Instantly share code, notes, and snippets.

@besrabasant
Last active March 3, 2020 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save besrabasant/dd46023f2e09a9000db6db26099e0ae1 to your computer and use it in GitHub Desktop.
Save besrabasant/dd46023f2e09a9000db6db26099e0ae1 to your computer and use it in GitHub Desktop.
A handy middleware to disable Laravel Debugbar.
<?php
namespace App\Http\Middleware;
use Closure;
use Barryvdh\Debugbar\Facade as Debugbar;
class NoDebugbar
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
Debugbar::disable();
return $next($request);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment