hideSensitiveRequestDetails(); Telescope::filter(function (IncomingEntry $entry) { // @codeCoverageIgnoreStart if ($this->app->environment('local')) { return true; } return $entry->isReportableException() || $entry->isFailedRequest() || $entry->isFailedJob() || $entry->isScheduledTask() || $entry->hasMonitoredTag(); // @codeCoverageIgnoreEnd }); } /** * Prevent sensitive request details from being logged by Telescope. * * @return void */ protected function hideSensitiveRequestDetails() { if ($this->app->environment('local')) { return; // @codeCoverageIgnore } Telescope::hideRequestParameters(['_token']); Telescope::hideRequestHeaders([ 'cookie', 'x-csrf-token', 'x-xsrf-token', ]); } /** * Register the Telescope gate. * * This gate determines who can access Telescope in non-local environments. * * @return void */ protected function gate() { if (! $this->app->environment('local')) { Gate::define('viewTelescope', fn (User $user) => $user->is_instance_administrator); } } }