PHP code example of marvinlabs / laravel-discord-logger

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

    

marvinlabs / laravel-discord-logger example snippets


// config/app.php
'providers' => [
    ...
    MarvinLabs\DiscordLogger\ServiceProvider::class
];

// config/logging.php
'channels' => [
    //...
    'discord' => [
        'driver' => 'custom',
        'via'    => MarvinLabs\DiscordLogger\Logger::class,
        'level'  => 'debug',
        'url'    => env('LOG_DISCORD_WEBHOOK_URL'),
        'ignore_exceptions' => env('LOG_DISCORD_IGNORE_EXCEPTIONS', false),
    ],
];

// config/logging.php
'channels' => [
    //...
    'stack' => [
        'driver'   => 'stack',
        'channels' => ['single', 'discord'],
    ],
];
 bash
php artisan vendor:publish --provider "MarvinLabs\DiscordLogger\ServiceProvider"

LOG_CHANNEL=discord

LOG_CHANNEL=stack