| Total Complexity | 9 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class TelescopeServiceProvider extends TelescopeApplicationServiceProvider |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Register any application services. |
||
| 14 | * |
||
| 15 | * @return void |
||
| 16 | */ |
||
| 17 | public function register() |
||
| 18 | { |
||
| 19 | // Telescope::night(); |
||
| 20 | |||
| 21 | $this->hideSensitiveRequestDetails(); |
||
| 22 | |||
| 23 | Telescope::filter(function (IncomingEntry $entry) { |
||
| 24 | if ($this->app->environment('local')) { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | |||
| 28 | return $entry->isReportableException() || |
||
| 29 | $entry->isFailedRequest() || |
||
| 30 | $entry->isFailedJob() || |
||
| 31 | $entry->isScheduledTask() || |
||
| 32 | $entry->hasMonitoredTag(); |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Prevent sensitive request details from being logged by Telescope. |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | protected function hideSensitiveRequestDetails() |
||
| 53 | ]); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Register the Telescope gate. |
||
| 58 | * |
||
| 59 | * This gate determines who can access Telescope in non-local environments. |
||
| 60 | * |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | protected function gate() |
||
| 72 |