PHPackages                             kerodev/filament-logger - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. kerodev/filament-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

kerodev/filament-logger
=======================

Activity logger for filament

v1.0.2(2mo ago)148[2 PRs](https://github.com/keroles19/filament-logger/pulls)MITPHPPHP ^8.2CI passing

Since Jan 10Pushed 2mo agoCompare

[ Source](https://github.com/keroles19/filament-logger)[ Packagist](https://packagist.org/packages/kerodev/filament-logger)[ Docs](https://github.com/keroles19/filament-logger)[ RSS](/packages/kerodev-filament-logger/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (30)Versions (6)Used By (0)

Note

This is a fork of [Z3d0X/filament-logger](https://github.com/Z3d0X/filament-logger) with Filament 4 support. Now maintained by [keroles19](https://github.com/keroles19) with improvements and bug fixes.

Activity logger for filament
============================

[](#activity-logger-for-filament)

[![Latest Version on Packagist](https://camo.githubusercontent.com/12dbc592d1d0352b865a191c177bc00e2d24f9b2baa96068bab4262a5ab423d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b65726f6465762f66696c616d656e742d6c6f676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/kerodev/filament-logger)[![Total Downloads](https://camo.githubusercontent.com/948e723be15e44c7ba18981820e4811dd976287a37055bb0d38be41e31efa5f7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b65726f6465762f66696c616d656e742d6c6f676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/kerodev/filament-logger)

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

Features
--------

[](#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.

Development (Git hooks)
-----------------------

[](#development-git-hooks)

This repo includes a **`commit-msg` hook** that removes any `Made-with: Cursor` line from commit messages so it is never stored in history (some editors append that automatically).

After cloning, run **once** from the package root:

```
composer run setup-git-hooks
```

Or manually:

```
git config core.hooksPath .githooks
chmod +x .githooks/commit-msg
```

If a commit tool bypasses hooks, you can still amend with hooks disabled only when needed: `git -c core.hooksPath=/path/to/empty/dir commit --amend …`.

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

[](#installation)

Plugin VersionFilament Version&lt;= 0.5.x^2.110.6.x - 0.8.x3.x&gt;= 1.04.xThis package uses [spatie/laravel-activitylog](https://spatie.be/docs/laravel-activitylog), instructions for its setup can be found [here](https://spatie.be/docs/laravel-activitylog/v4/installation-and-setup)

You can install the package via composer:

```
composer require kerodev/filament-logger
```

After that run the install command:

```
php artisan filament-logger:install
```

This will publish the config &amp; migrations from `spatie/laravel-activitylog`

Register the plugin in your PanelProvider:

```
use Keroles\FilamentLogger\FilamentLoggerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentLoggerPlugin::make(),
        ]);
}
```

Authorization
-------------

[](#authorization)

To enforce policies on `ActivityResource`, after generating a policy, you would need to register `Spatie\Activitylog\Models\Activity` to use that policy in the AuthServiceProvider.

```
