Skip to content

Instantly share code, notes, and snippets.

@besrabasant
Last active August 15, 2024 14:25
Show Gist options
  • 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