File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 55use App \Mail \ExceptionOccurred ;
66use Illuminate \Support \Facades \Log ;
77use Illuminate \Support \Facades \Mail ;
8- use Symfony \Component \ErrorHandler \ErrorRenderer \HtmlErrorRenderer ;
98use Throwable ;
109
1110trait ExceptionNotificationHandlerTrait
@@ -52,11 +51,17 @@ public function report(Throwable $e): void
5251 public function sendEmail (Throwable $ exception ): void
5352 {
5453 try {
55- $ hasDebugModeEnabled = app ()->hasDebugModeEnabled ();
56- $ renderer = new HtmlErrorRenderer ($ hasDebugModeEnabled );
57- $ html = $ renderer ->render ($ exception );
54+ $ content = [
55+ 'message ' => $ exception ->getMessage (),
56+ 'file ' => $ exception ->getFile (),
57+ 'line ' => $ exception ->getLine (),
58+ 'trace ' => $ exception ->getTrace (),
59+ 'url ' => request ()->url (),
60+ 'body ' => request ()->all (),
61+ 'ip ' => request ()->ip (),
62+ ];
5863
59- Mail::send (new ExceptionOccurred ($ html ));
64+ Mail::send (new ExceptionOccurred ($ content ));
6065 } catch (Throwable $ exception ) {
6166 Log::error ($ exception );
6267 }
You can’t perform that action at this time.
0 commit comments