diff --git a/changelog.md b/changelog.md index 9723010..f70d532 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,8 @@ All notable changes to `ExceptionHandler` will be documented in this file. +# version 0.1.0 +- Add a a method to manually send exception by email (plus the same to call statically). # version 0.0.9 - Multiline exception message in mail. diff --git a/src/Exceptions/ExceptionHandler.php b/src/Exceptions/ExceptionHandler.php index fe9f4fa..733e506 100644 --- a/src/Exceptions/ExceptionHandler.php +++ b/src/Exceptions/ExceptionHandler.php @@ -50,6 +50,28 @@ class ExceptionHandler extends Handler parent::report($e); } + /** + * Manually send exception by email + * + * @param \Throwable $e + * @return void + */ + public static function sendExceptionByEmailStatic(\Throwable $e) + { + app(self::class)->sendExceptionByEmail($e); + } + + /** + * Manually send exception by email + * + * @param \Throwable $e + * @return void + */ + public function sendExceptionByEmail(\Throwable $e) + { + $this->reportExceptionByEmail()($e); + } + /** * Report sending mail closure *