PHPackages                             saade/filament-laravel-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. saade/filament-laravel-log

ActiveLibrary

saade/filament-laravel-log
==========================

Access laravel.log file through Filament admin panel

v4.0.0(7mo ago)117263.0k↓18.2%36[5 PRs](https://github.com/saade/filament-laravel-log/pulls)2MITPHPPHP ^8.2CI passing

Since Mar 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/saade/filament-laravel-log)[ Packagist](https://packagist.org/packages/saade/filament-laravel-log)[ Docs](https://github.com/saade/filament-laravel-log)[ GitHub Sponsors](https://github.com/saade)[ RSS](/packages/saade-filament-laravel-log/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (28)Used By (2)

Filament Laravel Log
====================

[](#filament-laravel-log)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dbcc7d633fd9bb0b47000f65f2e9f0f1e470b3e8a2c74d56b876c0c617287731/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616164652f66696c616d656e742d6c61726176656c2d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/saade/filament-laravel-log)[![Total Downloads](https://camo.githubusercontent.com/cc668eced76e4204ef916edd2feb065aaa0165f25fed08dd56d823bc2519422e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616164652f66696c616d656e742d6c61726176656c2d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/saade/filament-laravel-log)

 [![Banner](https://raw.githubusercontent.com/saade/filament-laravel-log/3.x/art/cover1.png)](https://raw.githubusercontent.com/saade/filament-laravel-log/3.x/art/cover1.png)

Features
========

[](#features)

- Syntax highlighting
- Light/ Dark mode
- Quickly jump between start and end of the file
- Refresh log contents
- Clear log contents
- Search multiple files in multiple directories
- Ignored file patterns

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require saade/filament-laravel-log:^3.0
```

Important

If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme) first.

After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.

```
@import '../../../../vendor/saade/filament-laravel-log/resources/css/filament-laravel-log.css';

@source '../../../../vendor/saade/filament-laravel-log/resources/views/**/*.blade.php';
```

Usage
-----

[](#usage)

Add the `Saade\FilamentLaravelLog\FilamentLaravelLogPlugin` to your panel config.

```
use Saade\FilamentLaravelLog\FilamentLaravelLogPlugin;

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

Configuration
-------------

[](#configuration)

### Customizing the navigation

[](#customizing-the-navigation)

```
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')
```

### Customizing the log search

[](#customizing-the-log-search)

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

### Authorization

[](#authorization)

If you would like to prevent certain users from accessing the logs page, you should add a `authorize` callback in the FilamentLaravelLogPlugin chain.

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

### Customizing the log page

[](#customizing-the-log-page)

To customize the log page, you can extend the `Saade\FilamentLaravelLog\Pages\ViewLog` page and override its methods.

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

class ViewLog extends BaseViewLog
{
    // Your implementation
}
```

```
use App\Filament\Pages\ViewLog;

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

### Customizing the editor appearance

[](#customizing-the-editor-appearance)

Publish the config file:

```
php artisan vendor:publish --tag="log-config"
```

This is the contents of the published config file:

```
