cweagans / filament-logger

Configurable activity logger for filament.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Activity logger for filament

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

Configurable activity logger for filament. Powered by spatie/laravel-activitylog

Features

You can choose what you want to log and how to log it.

  • Log Filament Resource Events
  • Log Login Event
  • Log Notification Events
  • Log Model Events
  • Easily extendable to log custom events

Note: By default this package will log Filament Resource Events, Access(Login) Events, and Notification Events. If you want to log a model that is not a FilamentResource you will have to manually register in the config file.

Installation

This package uses spatie/laravel-activitylog, instructions for its setup can be found here

You can install the package via composer:

composer require z3d0x/filament-logger

You can publish the config file with:

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

This is the contents of the published config file:

<?php
return [
    'activity_resource' => \Z3d0X\FilamentLogger\Resources\ActivityResource::class,

    'resources' => [
        'enabled' => true,
        'log_name' => 'Resource',
        'logger' => \Z3d0X\FilamentLogger\Loggers\ResourceLogger::class,
        'color' => 'success',
        'exclude' => [
            //App\Filament\Resources\UserResource::class,
        ],
    ],

    'access' => [
        'enabled' => true,
        'logger' => \Z3d0X\FilamentLogger\Loggers\AccessLogger::class,
        'color' => 'danger',
        'log_name' => 'Access',
    ],

    'notifications' => [
        'enabled' => true,
        'logger' => \Z3d0X\FilamentLogger\Loggers\NotificationLogger::class,
        'color' => null,
        'log_name' => 'Notification',
    ],

    'models' => [
        'enabled' => true,
        'log_name' => 'Model',
        'color' => 'warning',
        'logger' => \Z3d0X\FilamentLogger\Loggers\ModelLogger::class,
        'register' => [
            //App\Models\User::class,
        ],
    ],

    'custom' => [
        // [
        //     'log_name' => 'Custom',
        //     'color' => 'primary',
        // ]
    ]
];

Future Scope

  • Log spatie/laravel-settings

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.

About

Configurable activity logger for filament.

License:MIT License


Languages

Language:PHP 100.0%