diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 575acd5..fe23f5a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,6 +26,7 @@ public function boot() public function register() { $this->registerExceptionHandler(); + $this->registerTelescope(); } /** @@ -39,4 +40,14 @@ protected function registerExceptionHandler() return new ApiExceptionHandler($app['Illuminate\Contracts\Debug\ExceptionHandler'], Config('api.errorFormat'), Config('api.debug')); }); } + + /** + * Conditionally register the telescope service provider + */ + protected function registerTelescope() + { + if ($this->app->environment('local', 'testing')) { + $this->app->register(TelescopeServiceProvider::class); + } + } } diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php index 73d5de0..945ba08 100644 --- a/app/Providers/TelescopeServiceProvider.php +++ b/app/Providers/TelescopeServiceProvider.php @@ -27,10 +27,7 @@ public function register() return true; } - return $entry->isReportableException() || - $entry->isFailedJob() || - $entry->isScheduledTask() || - $entry->hasMonitoredTag(); + return false; }); } diff --git a/composer.json b/composer.json index fa096c2..6b59ba5 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,9 @@ }, "extra": { "laravel": { - "dont-discover": [] + "dont-discover": [ + "laravel/telescope" + ] } }, "autoload": { diff --git a/config/app.php b/config/app.php index d62d95b..c9960cd 100644 --- a/config/app.php +++ b/config/app.php @@ -173,7 +173,6 @@ App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, - App\Providers\TelescopeServiceProvider::class, App\Providers\RouteServiceProvider::class, ],