https://github.com/pxlrbt/filament-activity-log
Spatie activity log integration into Filament
https://github.com/pxlrbt/filament-activity-log
filamentadmin filamentphp laravel
Last synced: about 1 year ago
JSON representation
Spatie activity log integration into Filament
- Host: GitHub
- URL: https://github.com/pxlrbt/filament-activity-log
- Owner: pxlrbt
- License: mit
- Created: 2023-05-22T12:07:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-02T05:26:05.000Z (over 1 year ago)
- Last Synced: 2025-04-07T04:04:48.777Z (about 1 year ago)
- Topics: filamentadmin, filamentphp, laravel
- Language: PHP
- Homepage:
- Size: 432 KB
- Stars: 173
- Watchers: 6
- Forks: 28
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-filament - Activity Log - Add a Filament page that nicely shows your spatie/laravel-activitylog. (Plugins / Administration & Management)
README

# Filament Activity Log
[](https://packagist.org/packages/pxlrbt/filament-activity-log)
[](LICENSE.md)

[](https://packagist.org/packages/pxlrbt/filament-activity-log)
This package adds a page to the Filament Admin panel to view the activity log generated by [`spatie/laravel-activitylog`](https://github.com/spatie/laravel-activitylog).

## Installation
| Plugin Version | Filament Version | PHP Version |
|----------------|-----------------|-------------|
| 0.1.x | 2.x | \> 8.0 |
| 1.x | 3.x | \> 8.1 |
Install via Composer.
**Requires PHP 8.0 and Filament 2.0**
```bash
composer require pxlrbt/filament-activity-log
```
> **Warning**
> This plugin only offers a page to show activities related to your model. You need [`spatie/laravel-activitylog`](https://github.com/spatie/laravel-activitylog) installed and configured for it to work. It is important you are using the `LogsActivity` trait as per [Spatie's docs](https://spatie.be/docs/laravel-activitylog/v4/advanced-usage/logging-model-events) for this work as we use the '->activities()' method of the trait.
## Usage
Make sure you use a **custom theme** and the vendor folder for this plugins is published, so that it includes the Tailwind CSS classes.
### Create a page
Create the page inside your resources `Pages/` directory. Replace `UserResource` with your resource.
```php
Pages\ListUsers::route('/'),
'create' => Pages\CreateUser::route('/create'),
'activities' => Pages\ListUserActivities::route('/{record}/activities'),
'edit' => Pages\EditUser::route('/{record}/edit'),
];
}
```
### Link to your page
Use a Filament action to link to your from your table or page.
```php
$table->actions([
Action::make('activities')->url(fn ($record) => YourResource::getUrl('activities', ['record' => $record]))
]);
```
## Contributing
If you want to contribute to this packages, you may want to test it in a real Filament project:
- Fork this repository to your GitHub account.
- Create a Filament app locally.
- Clone your fork in your Filament app's root directory.
- In the `/filament-activity-log` directory, create a branch for your fix, e.g. `fix/error-message`.
Install the packages in your app's `composer.json`:
```json
"require": {
"pxlrbt/filament-activity-log": "dev-fix/error-message as main-dev",
},
"repositories": [
{
"type": "path",
"url": "filament-activity-log"
}
]
```
Now, run `composer update`.