diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 313bd3ae..9fdcd26f 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -197,7 +197,7 @@ class AuthController extends Controller Log::info("[Password Reset] Mail has been sent to [{$request->input('email')}] with token [$token]"); } catch (\Exception $e) { // Write the exception to log - app(\Illuminate\Foundation\Exceptions\Handler::class)->report($e); + report($e); return json(trans('auth.mail.failed', ['msg' => $e->getMessage()]), 2); } diff --git a/app/helpers.php b/app/helpers.php index adbcdc71..29bc3764 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -493,3 +493,16 @@ if (! function_exists('get_db_config')) { return config("database.connections.$type"); } } + +if (! function_exists('report')) { + /** + * Report an exception. + * + * @param \Exception $exception + * @return void + */ + function report($exception) + { + app(Illuminate\Contracts\Debug\ExceptionHandler::class)->report($exception); + } +}