Download the PHP package pxlrbt/filament-activity-log without Composer
On this page you can find all versions of the php package pxlrbt/filament-activity-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pxlrbt/filament-activity-log
More information about pxlrbt/filament-activity-log
Files in pxlrbt/filament-activity-log
Package filament-activity-log
Short Description Spatie's Laravel Activity Log integrated into Filament
License MIT
Informations about the package filament-activity-log
Filament Activity Log
This package adds pages to the Filament Admin panel to view the activity log generated by spatie/laravel-activitylog.
Installation
| Plugin Version | Filament Version | Activitylog | PHP Version |
|---|---|---|---|
| 0.1.x | 2.x | 4.x | > 8.0 |
| 1.x | 3.x | 4.x | > 8.1 |
| 2.x | 4.x, 5.x | 4.x | > 8.1 |
| 3.x | 5.x | 5.x | > 8.4 |
Install via Composer.
Requires PHP 8.1, Filament 4.0 or 5.0, and spatie/laravel-activitylog 4.7 or 5.0
Warning This plugin offers two pages: one listing activities on a subject (use
ListActivitiesBySubject) and one listing activities caused by a record such as a user (useListActivitiesByCauser). You needspatie/laravel-activityloginstalled and configured for it to work. The subject page uses theLogsActivitytrait'sactivitiesAsSubject()relation; the causer page uses theCausesActivitytrait'sactivitiesAsCauser()relation.
Filament v4 Upgrade
Make sure you have a custom theme, add this line and recompile: @import '../../../../vendor/pxlrbt/filament-activity-log/resources/css/styles.css';
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.
Listing activities for a subject
Use ListActivitiesBySubject to show all activities recorded on a record (e.g. every change to an order).
Setup spatie/laravel-activitylog
Make sure your resource model uses the LogsActivity trait.
Create a ListActivitiesBySubject page
Create the page inside your resource's Pages/ directory. Replace OrderResource with your resource.
Note The legacy class
ListActivitiesis kept as an abstract alias ofListActivitiesBySubject, so existing subclasses continue to work.
Register the page
Add the page to your resource's getPages() method.
Listing activities caused by a record
Use ListActivitiesByCauser to show all activities a record (typically a user) has caused across every subject. Each row links to the affected subject's resource when one is registered.
Setup spatie/laravel-activitylog
Make sure your user model uses the CausesActivity trait.
Create a ListActivitiesByCauser page
Create the page inside your UserResource's Pages/ directory.
See https://spatie.be/docs/laravel-activitylog/v5/advanced-usage/logging-model-events for more information on the topic.
Register the page
Add the page to your resource's getPages() method.
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-logdirectory, create a branch for your fix, e.g.fix/error-message.
Install the packages in your app's composer.json:
Now, run composer update.
All versions of filament-activity-log with dependencies
filament/filament Version ^4.0|^5.0
spatie/laravel-activitylog Version ^5.0