Laravel debugger - enable/disable depending on IP address while caching implemented
Debugger has functionality to enable/disable it at runtime :
\Debugbar::enable();
\Debugbar::disable();
If you want to use the debugbar in production, disable in the config and only enable when needed.
So you can do :
if(in_array($request->ip(), [ip addresses])) {
\Debugbar::enable();
// Forcing the cache to be cleared
// Not recommended but if and only if required
\Artisan::call('cache:clear');
}
Please check documentation for more help.