File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -24,27 +24,17 @@ trait ExceptionNotificationHandlerTrait
2424 ];
2525
2626 /**
27- * Report or log an exception.
28- *
29- * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
30- *
31- * @return void
27+ * Register the exception handling callbacks for the application.
3228 */
33- public function report ( Throwable $ e )
29+ public function register (): void
3430 {
35- $ enableEmailExceptions = config ('exceptions.emailExceptionEnabled ' );
36-
37- if ($ enableEmailExceptions === '' ) {
38- $ enableEmailExceptions = config ('exceptions.emailExceptionEnabledDefault ' );
39- }
31+ $ this ->reportable (function (Throwable $ e ) {
32+ $ enableEmailExceptions = config ('exceptions.emailExceptionEnabled ' , true );
4033
41- if ($ enableEmailExceptions ) {
42- if ($ this ->shouldReport ($ e )) {
34+ if ($ enableEmailExceptions && $ this ->shouldReport ($ e )) {
4335 $ this ->sendEmail ($ e );
4436 }
45- }
46-
47- parent ::report ($ e );
37+ });
4838 }
4939
5040 /**
You can’t perform that action at this time.
0 commit comments