PHP code example of shaffe / laravel-mail-log-channel

1. Go to this page and download the library: Download shaffe/laravel-mail-log-channel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shaffe / laravel-mail-log-channel example snippets


$app->register(Shaffe\MailLogChannel\MailLogChannelServiceProvider::class);

'channels' => [
    'stack' => [
        'driver' => 'stack',
        // 2. Add mail to the stack:
        'channels' => ['single', 'mail'],
    ],

    // ...

    // 1. Create a mail logging channel:
    'mail' => [
        'driver' => 'mail',
        'level' => env('LOG_MAIL_LEVEL', 'notice'),

        // Specify mail recipient
        'to' => [
            [
                'address' => env('LOG_MAIL_ADDRESS'),
                'name' => 'Error',
            ],
        ],

        'from' => [
            // Defaults to config('mail.from.address')
            'address' => env('LOG_MAIL_ADDRESS'),
            // Defaults to config('mail.from.name')
            'name' => 'Errors'
        ],

        // Optionally overwrite the subject format pattern
        // 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'),

        // Optionally overwrite the mailable template
        // Two variables are sent to the view: `string $content` and `array $records`
        // 'mailable' => NewLogMailable::class
    ],
],

    'to' => env('LOG_MAIL_ADDRESS', ''),
    

    'to' => explode(',', env('LOG_MAIL_ADDRESS', '')),
    

    'to' => [env('LOG_MAIL_ADDRESS', '') => 'Error'],`
    

    'to' => [
         [
             'address' => env('LOG_MAIL_ADDRESS', ''),
             'name' => 'Error',
         ],
     ],