PHP code example of dyanakiev / laravel-logger-discord-channel

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

    

dyanakiev / laravel-logger-discord-channel example snippets


'channels' => [
        'discord' => [
            'driver' => 'custom',
            'via' => dyanakiev\LoggerDiscordChannel\DiscordLogger::class,
            'suffix' => env('DISCORD_LOG_SUFFIX','Laravel Log'), // Message title suffix
            'webhook' => env('DISCORD_LOG_WEBHOOK', false), // e.g. https://discordapp.com/api/webhooks/...
            'level' => env('DISCORD_LOG_LEVEL', 'debug'), // You can choose from: emergency, alert, critical, error, warning, notice, info and debug
            'context' => env('DISCORD_LOG_CONTEXT', false), // Enable this if you want to receive the full context of an error, usually useless
            'environment' => env('DISCORD_LOG_ENVIRONMENT', 'production'), // Enable logging only for environment ['production', 'staging', 'local']
            'message' => env('DISCORD_LOG_MESSAGE', false), // Here you can put extra message or tag role or person via @personName
        ],
],
bash
php artisan config:clear
bash
php artisan config:cache