bernhard Posted January 9, 2023 Posted January 9, 2023 Hey @adrian I have this hook in place: $wire->addHookAfter("/foo", function () { return "foo"; }); And the page shows "foo" as expected. But it also shows the debug bar and I did not find an easy solution for disabling it... Is there (or could there be ? ) something like this: $wire->addHookAfter("/foo", function () { $this->wire->tracy->noBar = true; return "foo"; });
3fingers Posted January 9, 2023 Posted January 9, 2023 Hey @bernhard, the "disable tracy" button in the debug bar is invoking a js method "disableTracy()" which does this: function disableTracy() { document.cookie = "tracyDisabled=1; expires=0; path=/"; location.reload(); } Maybe you can then, in your hook url, use the WireHttp:setCookie() method and do the same as above? Let me know :)
adrian Posted January 10, 2023 Posted January 10, 2023 Hey @bernhard - any particular reason you want it disabled? That said, you can do what you want very easily by adding this in your URL hook. \Tracy\Debugger::$showBar = false; 1
bernhard Posted January 10, 2023 Author Posted January 10, 2023 Thx, that works! I'm working on my pagebuilder and have a mobile preview where the debug bar is a little disturbing I guess. But I might hide it via CSS so that it is still visible on desktop view, I'm not sure: Good to know how to disable the debug bar though - thx!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now