hideSensitiveRequestDetails(); $isLocal = $this->app->environment('local'); Telescope::filter(function (IncomingEntry $incomingEntry) use ($isLocal) { if ($isLocal) { return true; } if ($incomingEntry->isReportableException()) { return true; } if ($incomingEntry->isFailedRequest()) { return true; } if ($incomingEntry->isFailedJob()) { return true; } if ($incomingEntry->isScheduledTask()) { return true; } return $incomingEntry->hasMonitoredTag(); }); } /** * Prevent sensitive request details from being logged by Telescope. */ protected function hideSensitiveRequestDetails(): void { if ($this->app->environment('local')) { return; } 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. */ protected function gate(): void { Gate::define('viewTelescope', function ($user) { $root_user = User::query()->find(0); return $user->email == $root_user->email; }); } }