Usually on production you never need those debug messages.
Open .env file
APP_DEBUG=false
and clear cache
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi.
Laravel debug info is really useful and helps me.
When I developing an API or something server-side functions, sometimes I don't need those debug messages.
How should I disable those debug modes?
Roeute::get( '/delivery_statement', function() {
\Debugbar::disable(); // this doesn't woks at here
some_undefined_function_called_it_causes_an_error();
});
curl -H 'Laravel-Disable-Debug: disabled' http://localhost/api/path-to/debug
Any ideas?
Thanks!
Please or to participate in this conversation.