gboquizosanchez/filament-log-viewer

1.2.6 2025-06-30 16:20 UTC

This package is auto-updated.

Last update: 2025-06-30 17:24:43 UTC


README

Latest Stable Version License Downloads

Summary

This package allows you to manage and keep track of each one of your log files in Filament panels.

Based on ARCANEDEV LogViewer.

Starting 🚀

Prerequisites 📋

  • Composer.
  • PHP version 8.3 or higher.

Running 🛠️

Install the package via composer:

composer require gboquizosanchez/filament-log-viewer

And register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make())

You can also publish the configuration file to customize the package:

php artisan vendor:publish --provider="Boquizo\FilamentLogViewer\FilamentLogViewerServiceProvider"

Others configurations

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->navigationGroup('System')
        ->navigationSort(2)
        ->navigationIcon('heroicon-s-document-text')
        ->navigationLabel('Log Viewer')
        ->authorize(fn() => auth()->user()->can('view-logs')),
    // Other plugins
])

Custom Pages Configuration

You can customize the plugin pages by extending the base classes:

// app/Filament/Pages/CustomListLogs.php
<?php

namespace App\Filament\Pages;

use Boquizo\FilamentLogViewer\Pages\ListLogs as BaseListLogs;
use Filament\Tables\Table;

class CustomListLogs extends BaseListLogs
{
    protected static ?string $navigationLabel = 'Application Logs';
    
    protected static ?string $navigationGroup = 'Monitoring';
    
    public function table(Table $table): Table
    {
        return parent::table($table)
            ->defaultPaginationPageOption(25)
            ->poll('30s'); // Auto-refresh every 30 seconds
    }
}
// app/Filament/Pages/CustomViewLog.php
<?php

namespace App\Filament\Pages;

use Boquizo\FilamentLogViewer\Pages\ViewLog as BaseViewLog;
use Filament\Actions\Action;

class CustomViewLog extends BaseViewLog
{
    protected function getHeaderActions(): array
    {
        return array_merge(parent::getHeaderActions(), [
            Action::make('export')
                ->label('Export to CSV')
                ->icon('heroicon-o-arrow-down-tray')
                ->action(fn() => $this->exportToCsv()),
        ]);
    }
    
    private function exportToCsv(): void
    {
        // Custom export logic
    }
}

Then register your custom pages in the plugin configuration:

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->listLogs(\App\Filament\Pages\CustomListLogs::class)
        ->viewLog(\App\Filament\Pages\CustomViewLog::class)
        ->navigationGroup('System')
        ->navigationSort(2)
        ->navigationIcon('heroicon-s-document-text')
        ->navigationLabel('System Logs')
        ->authorize(function () {
            return auth()->user()->hasAnyRole(['admin', 'developer']);
        }),
    // Other plugins like FilamentEmailPlugin, etc.
])

Screenshots 💄

Panel

PHP dependencies 📦

  • Calebporzio Sushi Latest Stable Version
  • Eightynine Filament Advanced Widgets Latest Stable Version
  • Owenvoke Blade Fontawesome Latest Stable Version

Develop dependencies 🔧

  • Friendsofphp Php Cs Fixer Latest Stable Version
  • Hermes Dependencies Latest Stable Version
  • Larastan Larastan Latest Stable Version
  • Orchestra Testbench Latest Stable Version
  • Pestphp Pest Latest Stable Version

Problems? 🚨

Let me know about yours by opening an issue!

Credits 🧑‍💻

License 📄

MIT License (MIT). See License File.