Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

phayes0289's avatar

Disable DebugBar (barryvdh/laravel-debugbar) in API

I am beginning work on my first API call, but it seems "barryvdh/laravel-debugbar": "^3.6" is interfering with the output. How do I disable it in JUST the API area of my app?

0 likes
4 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

I have never had this problem. It should automatically only be added when returning strings (html for instance). Can you show the code?

2 likes
phayes0289's avatar

@Sinnbeck You are correct. I was testing using a simple function that returned a string. When I connected it to the actual controller, it did not pose a problem. It returned a JSON string as expected. Thanks for the lesson.

Please or to participate in this conversation.