Home > Software design >  How to check programatically if Debugbar is installed?
How to check programatically if Debugbar is installed?

Time:01-28

Which is best way in laravel 9 app to check programatically if Debugbar(and its functions are available) installed in current installation ?

Thanks!

CodePudding user response:

try running $debugbarIsInstalled = class_exists(Debugbar::class)

when return true means Debugbar is installed

CodePudding user response:

You can use the bound method to see if it's bound to the laravel Container.

if (app()->bound('debugbar')) {
    app('debugbar')->disable();
}
  • Related