@@ -9,8 +9,6 @@ A service provider to add support for logging via email using Laravels built-in
99
1010This package is a fork of [ laravel-log-mailer] ( https://packagist.org/packages/designmynight/laravel-log-mailer ) by Steve Porter.
1111
12- ** This fork introduces some breaking changes. If you're upgrading from it, please follow the [ configuration] ( #configuration ) bellow.**
13-
1412![ image] ( https://user-images.githubusercontent.com/12199424/45576336-a93c1300-b86e-11e8-9575-d1e4c5ed5dec.png )
1513
1614
@@ -33,8 +31,8 @@ composer require shaffe/laravel-mail-log-channel
3331
3432 Laravel | Package |
3533:---------|:--------|
36- 7.x | 2.0 .x |
37- 6.x | 2.0 .x |
34+ 7.x | 1.1 .x |
35+ 6.x | 1.1 .x |
3836 5.6.x | 1.0.x |
3937
4038The package will automatically register itself if you use Laravel.
@@ -77,15 +75,13 @@ To ensure all unhandled exceptions are mailed:
7775 ]
7876 ],
7977
80- // Optionally overwrite the sender.
81- // Default is config('mail.from.address') and config('mail.from.name')
82- // 'from' => [
83- // 'address' => env('LOG_MAIL_ADDRESS'),
84- // 'name' => 'Errors'
85- // ],
78+ 'from' => [
79+ 'address' => env('LOG_MAIL_ADDRESS'),
80+ 'name' => 'Errors'
81+ ],
8682
8783 // Optionally overwrite the subject format pattern
88- // 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'),
84+ 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'),
8985
9086 // Optionally overwrite the mailable template
9187 // Two variables are sent to the view: `string $content` and `array $records`
@@ -94,4 +90,35 @@ To ensure all unhandled exceptions are mailed:
9490],
9591```
9692
93+ The following ` to ` config formats are supported:
94+
95+ * single email address:
96+
97+ ``` php
98+ 'to' => env('LOG_MAIL_ADDRESS', ''),
99+ ```
100+
101+ * array of email addresses:
102+
103+ ```php
104+ 'to' => explode(',', env('LOG_MAIL_ADDRESS', '')),
105+ ```
106+
107+ * associative array of email/name addresses:
108+
109+ ```php
110+ 'to' => [env('LOG_MAIL_ADDRESS', '') => 'Error'],`
111+ ```
112+
113+ * an array of email and name:
114+
115+ ```php
116+ 'to' => [
117+ [
118+ 'address' => env('LOG_MAIL_ADDRESS', ''),
119+ 'name' => 'Error',
120+ ],
121+ ],
122+ ```
123+
97124You can specify multiple channels and change the recipients and customize the email template per channel.
0 commit comments