Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Z3d0X/filament-logger
Extensible activity logger for filament that works out-of-the-box.
https://github.com/Z3d0X/filament-logger
activity-logger activitylog filamentadmin filamentphp hacktoberfest laravel laravel-filament log logger
Last synced: 3 months ago
JSON representation
Extensible activity logger for filament that works out-of-the-box.
- Host: GitHub
- URL: https://github.com/Z3d0X/filament-logger
- Owner: Z3d0X
- License: mit
- Created: 2022-04-25T14:36:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T12:53:16.000Z (7 months ago)
- Last Synced: 2024-11-05T22:44:47.525Z (3 months ago)
- Topics: activity-logger, activitylog, filamentadmin, filamentphp, hacktoberfest, laravel, laravel-filament, log, logger
- Language: PHP
- Homepage:
- Size: 560 KB
- Stars: 287
- Watchers: 4
- Forks: 42
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-filament - Z3d0X/filament-logger - Extensible activity logger for filament that works out-of-the-box. Uses [spatie/laravel-activitylog](https://github.com/spatie/laravel-activitylog) under the hood. (Logging)
README
# Activity logger for filament
[![Latest Version on Packagist](https://img.shields.io/packagist/v/z3d0x/filament-logger.svg?style=for-the-badge)](https://packagist.org/packages/z3d0x/filament-logger)
[![Total Downloads](https://img.shields.io/packagist/dt/z3d0x/filament-logger.svg?style=for-the-badge)](https://packagist.org/packages/z3d0x/filament-logger)
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 eventsNote: 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
| Plugin Version | Filament Version |
|----------------|------------------|
| < 0.5.x | ^2.11 |
| >= 0.6.0 | 3.x |This 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:
```bash
composer require z3d0x/filament-logger
```
After that run the install command:```bash
php artisan filament-logger:install
```
This will publish the config & migrations from `spatie/laravel-activitylog`For Filament v3, you need to register a resource in PanelProvider
```php
public function panel(Panel $panel): Panel
{
return $panel
->resources([
config('filament-logger.activity_resource')
]);
}
```
## 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.
```php
ActivityPolicy::class,
];
//...
}
```
> If you are using [Shield](https://filamentphp.com/plugins/shield) just register the ActivityPolicy generated by it## Translations
Publish the translations using:```bash
php artisan vendor:publish --tag="filament-logger-translations"
```## Activity Model resolution
The main `Activity` class being used by the Filament Resource instance will be resolved by Spatie's service provider, which loads the model defined by the configuration key found at `activitylog.activity_model` in `config/activitylog.php`.## Screenshots
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Ziyaan Hassan](https://github.com/Z3d0X)
- [Spatie Activitylog Contributors](https://github.com/spatie/laravel-activitylog#credits)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.