Selectively Disabling the Laravel Debugbar


Committed to the LaraBrain by: wjgilmore (@wjgilmore) at November 12, 2015 4:32 pm

The Laravel Debugbar is an indispensable tool, but sometimes you need to disable it for certain controllers

If a controller or particular controller action is tasked with returning JSON or XML then you probably don't want the Laravel Debugbar getting in the way. Fortunately disabling it is very easy, done by adding the following line to the top of your controller (or controller action):