Search by

microcode / filament-log-hub

vitkonovaluck

Filament plugin to collect Laravel logs, browse them in admin, and notify messengers

Package info

github.com/vitkonovaluck/filament-log-hub

pkg:composer/microcode/filament-log-hub

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.3.0 2026-08-25 20:06 UTC

This package is auto-updated.

Last update: 2026-08-25 20:07:49 UTC


README

Collect Laravel/Monolog logs into the database, browse them in a Filament panel, and send alerts through microcode/filament-integrations messengers (Telegram, Viber, WhatsApp).

Requirements

  • PHP 8.3+
  • Laravel 12 / 13
  • Filament 4 / 5
  • microcode/filament-integrations ^1.1

Installation

composer require microcode/filament-log-hub
php artisan migrate

This also installs microcode/filament-integrations. Register Integrations (credentials) and Log Hub on the Filament panel. If you skip Integrations, Log Hub registers it automatically:

use Microcode\FilamentIntegrations\IntegrationsPlugin;
use Microcode\FilamentLogHub\FilamentLogHubPlugin;

->plugin(
    IntegrationsPlugin::make()
        ->navigationGroup('Settings')
        ->only(['telegram', 'viber', 'whatsapp'])
)
->plugin(
    FilamentLogHubPlugin::make()
        ->authorize(fn (): bool => auth()->user()?->isSuperAdmin() ?? false)
        ->navigationGroup('Settings')
        ->navigationSort(40)
)

Register Integrations before Log Hub if you want a custom only() / except() list.

Ensure the default log stack includes the log-hub channel (enabled automatically when LOG_HUB_TAP_STACK=true), or add it manually:

LOG_STACK=single,log-hub

Telegram / messengers

  1. Configure the bot/API credentials on the Integrations page (or services.telegram.bot_token / .env).
  2. Set destination chat IDs / @channels / phone numbers in Log Hub Settings.

LOG_HUB_TELEGRAM_BOT_TOKEN is still copied into services.telegram.bot_token when that config key is empty.

Configuration

Env Description
LOG_HUB_ENABLED Master switch
LOG_HUB_LEVELS Comma-separated levels to store (default warning,error,critical,alert,emergency)
LOG_HUB_NOTIFY_LEVELS Levels that trigger messengers
LOG_HUB_NOTIFY_DRIVERS Driver keys (default telegram; also viber, whatsapp)
LOG_HUB_TELEGRAM_BOT_TOKEN Optional fallback Telegram token if Integrations is empty
LOG_HUB_TELEGRAM_CHAT_IDS Default Telegram chat IDs / @channels
LOG_HUB_VIBER_RECIPIENTS Default Viber user IDs
LOG_HUB_WHATSAPP_RECIPIENTS Default WhatsApp phone numbers
LOG_HUB_QUEUE Queue for alert jobs
LOG_HUB_RETENTION_DAYS Auto-purge age; 0 disables
LOG_HUB_TAP_STACK Append log-hub to the default stack

Runtime overrides (levels, channels, drivers, retention, messenger recipients) can also be changed from the Log Hub Settings action on the Log Hub page.

Purge old rows:

php artisan log-hub:purge
php artisan log-hub:purge --days=14

Custom messenger drivers

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...
        }
    };
});

Then enable discord in settings or LOG_HUB_NOTIFY_DRIVERS.

License

MIT