laravel-api-debugger icon indicating copy to clipboard operation
laravel-api-debugger copied to clipboard

Enable / Disable Switch

Open gabi85ro opened this issue 4 years ago • 9 comments

Is there any option to disable debugging dynamically, for example to enable for certain requests and disable for others? Something like:

Debugger::disable();
Debugger::enable();

Thank you

gabi85ro avatar Jun 19 '20 14:06 gabi85ro

I've just needed a similar functionality, although it's a off for a specific response rather than specific parts of the profiling.

I've PR'd it, feel free to use or not https://github.com/mlanin/laravel-api-debugger/pull/30

Rich2k avatar Apr 22 '21 10:04 Rich2k

+1

Im trying to change config via middleware, but it doesnt work(((

ErriourMe avatar Jul 15 '21 13:07 ErriourMe

@ErriourMe It won't work via a middleware before the package uses the ServiceProvider@boot to check if the package is enabled or not. I am trying too to switch on demand. Did you get any solution over there?

@Rich2k How can I implement your PR locally? Thank you

bhaidar avatar Mar 08 '24 19:03 bhaidar

You can either fork my branch yourself or include my forked repo directly in your composer file (rather than packagist) https://stackoverflow.com/questions/12954051/use-php-composer-to-clone-git-repo

Rich2k avatar Mar 08 '24 19:03 Rich2k

Thanks @Rich2k!

I am referencing your repo directly in my composer.json file.

For the branch, what shall I use? The feature/on-demand-disable-output?

Thanks

bhaidar avatar Mar 08 '24 20:03 bhaidar

Yep any other branches are just from the upstream

Rich2k avatar Mar 08 '24 20:03 Rich2k

@Rich2k I don't think I am loading the repo correctly.

Inside the composer.json file, I've added the following:

"require": {
   "lanin/laravel-api-debugger": "^4.0.0"
},
"repositories": [
        {
            "url": "https://github.com/rich2k/laravel-api-debugger.git",
            "type": "git"
        }
    ]

Still, I cannot find the lad_disable_output function.

I should be referencing the feature branch somewhere but not sure where.

bhaidar avatar Mar 08 '24 20:03 bhaidar

You don't want to use the version tag but the branch name

Use this

"rich2k/laravel-api-debugger": "dev-feature/on-demand-disable-output",

Rich2k avatar Mar 08 '24 20:03 Rich2k

Thanks @Rich2k works perfect!

bhaidar avatar Mar 08 '24 21:03 bhaidar