Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
fahedtms committed May 9, 2022
1 parent 684f364 commit ebf3602
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ This is the contents of the file which will be published at `config/exception-ma
```php

return [
/*
* enable or disable the package
*/
'enabled' => true,

/*
* Add email addresses you want them to receive the exception
*/
Expand Down
5 changes: 5 additions & 0 deletions config/exception-mail.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php

return [
/*
* enable or disable the package
*/
'enabled' => true,

/*
* Add email addresses you want them to receive the exception
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function report(Throwable $e)

public function sendEmail(Throwable $e)
{
$addresses = Config::get('exception-mail.addresses', []);
Mail::to($addresses)->send(new ExceptionOccurred($e->getMessage()));
if (Config::get('enabled')) {
$addresses = Config::get('exception-mail.addresses', []);
Mail::to($addresses)->send(new ExceptionOccurred($e->getMessage()));
}
}
}

0 comments on commit ebf3602

Please sign in to comment.