PHP code example of haruatari / yii2-discord-log-target
1. Go to this page and download the library: Download haruatari/yii2-discord-log-target 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/ */
haruatari / yii2-discord-log-target example snippets
// ...
'components' => [
'log' => [
'targets' => [
[
'__class' => \haruatari\yii2\discordLogTarget\DiscordTarget::class,
'webhookUrl' => "your webhook's url",
'messageTitle' => 'App name', // Application ID will be used if not specified
'avatarUrl' => 'https://your-avatar-image-url', // The image will be used as discord webhook avatar if specified
],
],
],
]
// ...