pxlrbt / filament-activity-log
Spatie's Laravel Activity Log integrated into Filament
Fund package maintenance!
pxlrbt
Installs: 144 185
Dependents: 2
Suggesters: 0
Security: 0
Stars: 164
Watchers: 5
Forks: 26
Open Issues: 9
Requires
- php: ^8.0
- filament/filament: ^3.0.5.0
- spatie/laravel-activitylog: ^4.7
Requires (Dev)
- laravel/pint: ^1.5
- dev-main
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.2.1
- v0.2.0
- v0.1.x-dev
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-notification-methods
- dev-tonypartridge/main
- dev-fix/js-not-found
- dev-feature/list-actions-filament-v2
- dev-feature/lang-de
This package is auto-updated.
Last update: 2024-12-18 13:46:08 UTC
README
Filament Activity Log
This package adds a page to the Filament Admin panel to view the activity log generated by spatie/laravel-activitylog
.
Installation
Install via Composer.
Requires PHP 8.0 and Filament 2.0
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
installed and configured for it to work. It is important you are using theLogsActivity
trait as per Spatie's docs 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 namespace App\Filament\Resources\UserResource\Pages; use pxlrbt\FilamentActivityLog\Pages\ListActivities; class ListUserActivities extends ListActivities { protected static string $resource = UserResource::class; }
Register the page
Add the page to your resource's getPages()
method.
public static function getPages(): array { return [ 'index' => 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.
$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
:
"require": { "pxlrbt/filament-activity-log": "dev-fix/error-message as main-dev", }, "repositories": [ { "type": "path", "url": "filament-activity-log" } ]
Now, run composer update
.