1. Go to this page and download the library: Download microcode/filament-log-hub 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/ */
use Microcode\FilamentLogHub\Contracts\MessengerDriver;
use Microcode\FilamentLogHub\Models\LogEntry;
use Microcode\FilamentLogHub\Support\MessengerManager;
app(MessengerManager::class)->extend('discord', function (): MessengerDriver {
return new class implements MessengerDriver {
public function key(): string
{
return 'discord';
}
public function isConfigured(): bool
{
return filled(config('services.discord.webhook_url'));
}
public function send(LogEntry $entry): void
{
// send webhook...
}
};
});