PHP code example of saade / filament-laravel-log

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

    

saade / filament-laravel-log example snippets


use Saade\FilamentLaravelLog\FilamentLaravelLogPlugin;

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

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

FilamentLaravelLogPlugin::make()
    ->logDirs([
        storage_path('logs'),     // The default value
        '/var/log/supervisor',
    ])
    ->excludedFilesPatterns([
        '*2023*',
    ])

FilamentLaravelLogPlugin::make()
    ->authorize(
        fn (): bool => auth()->user()->isAdmin()
    )

FilamentLaravelLogPlugin::make()
    ->authorize(
        fn (): bool => auth()->user()->can('view-logs')
    )

use Closure;
use Saade\FilamentLaravelLog\Pages\ViewLog as BaseViewLog;

class ViewLog extends BaseViewLog
{
    protected bool | Closure $isClearable = false;
}

use Saade\FilamentLaravelLog\Pages\ViewLog as BaseViewLog;

class ViewLog extends BaseViewLog
{
    // Your implementation
}

use App\Filament\Pages\ViewLog;

FilamentLaravelLogPlugin::make()
    ->viewLog(ViewLog::class)



return [
    /**
     * The tallest the editor grows, in lines, before it scrolls. The whole
     * file is loaded whatever this is set to.
     */
    'maxLines' => 50,

    /**
     * The height of the editor, in lines, when the file is shorter.
     */
    'minLines' => 10,

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

    /**
     * How many files the file picker lists before you search. Searching by
     * name finds the rest.
     */
    'limit' => 5,
];
bash
php artisan vendor:publish --tag="log-config"