Welcome Guest, Not a member yet? Register   Sign In
Is there a way to turn off the debugbar for a specific controller/route
#7

(This post was last modified: 02-25-2021, 10:00 AM by tibszabo.)

(11-06-2019, 07:43 AM)crazyR Wrote: As the title says, im seeking a way to disable the debugbar for specific controllers/routes.

Thank you.

For me, this is working:

before showing the view create a session var:

PHP Code:
session()->set('skip_debug',true); 

then in the app\Config\Toolbar.php create a constructor then remove the View::class if that var is present.

PHP Code:
public function __construct() {
        parent::__construct();
        
        
if (session()->get('skip_debug') === true) {
            session()->remove('skip_debug');
            array_splice($this->collectors,array_search(Views::class,$this->collectors),1);
        }
    
Reply


Messages In This Thread
RE: Is there a way to turn off the debugbar for a specific controller/route - by tibszabo - 02-25-2021, 09:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB