PHP code example of leobsst / filament-log-manager

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

    

leobsst / filament-log-manager example snippets


use Leobsst\FilamentLogManager\FilamentLogManager;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            // ...
            ->plugin(
                FilamentLogManager::make()
            );
    }
}

FilamentLogManager::make()
    ->navigationGroup('System')
    ->navigationParentItem('Tools')
    ->navigationLabel('Logs')
    ->navigationIcon('heroicon-o-server')
    ->activeNavigationIcon('heroicon-s-server')
    ->navigationBadge('+10')
    ->navigationBadgeColor('danger')
    ->navigationBadgeTooltip('New logs available')
    ->navigationSort(1)
    ->title('Application Logs')
    ->slug('logs')

FilamentLogManager::make()
  ->logDirs([
      storage_path('logs'), // The default value
  ])
  ->excludedFilesPatterns([
      '*2025*'
  ])

FilamentLogManager::make()
  ->authorize(
      fn () => auth()->user()->hasRole('admin')
  )

FilamentLogManager::make()
  ->canDeleteUsing(
      fn () => auth()->user()->hasRole('admin')
  )

FilamentLogManager::make()
  ->canDownloadUsing(
      fn () => auth()->user()->hasRole('support')
  )

use Leobsst\FilamentLogManager\Pages\Logs as BaseLogs;

class Logs extends BaseLogs
{
    // Your implementation
}

use App\Filament\Pages\Logs;

FilamentLogManager::make()
  ->viewLog(Logs::class)

return [
    //=======================================
    // LOG EDITOR INTERFACE
    //=======================================
    /**
     * Maximum amount of lines that editor will render.
     */
    'max_lines' => 45,

    /**
     * Minimum amount of lines that editor will render.
     */
    'min_lines' => 10,

    /**
     * Editor font size.
     */
    'font_size' => 12,

    //=======================================
    // FILE MANAGEMENT
    //=======================================
    /**
     * Set max file size reader
     * Default 5242880 = 5 MB
     */
    'max_file_size' => 5242880,

    //=======================================
    // PAGE FORM
    //=======================================
    /**
     * Limit the number of results returned from the search.
     * If set to -1 or null or 0 there is no limit.
     */
    'limit' => -1,
];
bash
php artisan vendor:publish --tag="filament-log-manager-config"