filament-log icon indicating copy to clipboard operation
filament-log copied to clipboard

A simplistic log viewer for your Filament apps.

A simplistics log viewer for your Filament apps.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a Logs page that allows you to view your Laravel log files in a simple UI.

Installation

You can install the package via Composer:

composer require ryangjchandler/filament-log

You can publish the config file with:

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

Optionally, you can publish the views using

php artisan vendor:publish --tag="filament-log-views"

This is the contents of the published config file:

return [

    'paths' => [
        storage_path('logs')
    ],

];

Usage

You should first publish the assets provided by this plugin:

php artisan vendor:publish --tag=filament-log-assets

This will publish the CSS files to public/vendor/filament-log.

The Logs page will be automatically registed with Filament and appear in your panel.

Authorization

If you would like to prevent certain users from accessing your page, you should register an authorization callback inside of a ServiceProvider::boot() method.

public function boot()
{
    Logs::can(function (User $user) {
        return $user->role === Role::Admin;
    });
}

This will prevent the navigation item from being registered.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.