PHP code example of munch / filament-logviewer

1. Go to this page and download the library: Download munch/filament-logviewer 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/ */

    

munch / filament-logviewer example snippets


use Munch\FilamentLogviewer\FilamentLogviewerPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ... other configuration
            ->plugins([
                FilamentLogviewerPlugin::make(),
            ]);
    }
}

return [
    // Path to log files
    'path' => storage_path('logs'),
    
    // Maximum file size to read (10MB default)
    'max_file_size' => 10 * 1024 * 1024,
    
    // Entries per page
    'per_page' => 50,
    
    // Navigation settings
    'navigation' => [
        'group' => 'Settings',
        'sort' => 100,
        'icon' => 'heroicon-o-document-text',
    ],
    
    // Date format
    'date_format' => 'Y-m-d H:i:s',
    
    // Log level colors
    'levels' => [
        'emergency' => ['label' => 'Emergency', 'color' => 'danger'],
        'alert' => ['label' => 'Alert', 'color' => 'danger'],
        'critical' => ['label' => 'Critical', 'color' => 'danger'],
        'error' => ['label' => 'Error', 'color' => 'danger'],
        'warning' => ['label' => 'Warning', 'color' => 'warning'],
        'notice' => ['label' => 'Notice', 'color' => 'info'],
        'info' => ['label' => 'Info', 'color' => 'success'],
        'debug' => ['label' => 'Debug', 'color' => 'gray'],
    ],
];
bash
php artisan vendor:publish --tag="filament-logviewer-config"