diff --git a/src/ExceptionNotifyServiceProvider.php b/src/ExceptionNotifyServiceProvider.php index fcd8801..c607b87 100644 --- a/src/ExceptionNotifyServiceProvider.php +++ b/src/ExceptionNotifyServiceProvider.php @@ -139,7 +139,10 @@ protected function registerTestCommand(): self protected function extendExceptionHandler(): self { $this->app->extend(ExceptionHandler::class, function (ExceptionHandler $exceptionHandler): ExceptionHandler { - if ($reportUsingCreator = config('exception-notify.report_using_creator')) { + if ( + ($reportUsingCreator = config('exception-notify.report_using_creator')) + && method_exists($exceptionHandler, 'reportable') + ) { /** @var callable(ExceptionHandler):callable|class-string $reportUsingCreator */ if (\is_string($reportUsingCreator) && class_exists($reportUsingCreator)) { $reportUsingCreator = $this->app->make($reportUsingCreator);