PHP code example of eslym / laravel-discord-webhook-log

1. Go to this page and download the library: Download eslym/laravel-discord-webhook-log 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/ */

    

eslym / laravel-discord-webhook-log example snippets



# config/logging.php

return [
// ...

    'channels' => [

// ...

        'discord' => [
            'driver' => 'monolog',
            'handler' => \Eslym\Laravel\Log\DiscordWebhook\DiscordWebhookHandler::class,
            'with' => [
                'webhook' => env('DISCORD_LOG_WEBHOOK'),
                'message' => env('DISCORD_LOG_MESSAGE'),
            ],
            'formatter' => \Monolog\Formatter\LineFormatter::class,
            'formatter_with' => [
                'format' => '%message% %context% %extra%',
                'allowInlineLineBreaks' => true,
                'ignoreEmptyContextAndExtra' => true,
            ],
        ],

// ...

    ],

// ...
]