Activity Log
Add a Filament page that nicely shows your spatie/laravel-activitylog.
Author:
Dennis Koch
Documentation

This package adds a page to the Filament Admin panel to view the activity log generated by spatie/laravel-activitylog.

#Installation
| Plugin Version | Filament Version | PHP Version |
|---|---|---|
| 0.1.x | 2.x | > 8.0 |
| 1.x | 3.x | > 8.1 |
| 2.x | 4.x, 5.x | > 8.1 |
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-activityloginstalled and configured for it to work. It is important you are using theLogsActivitytrait as per Spatie's docs for this work as we use the '->activities()' method of the trait.
#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.
#Create a page
Create the page inside your resources Pages/ directory. Replace OrderResource with your resource.
<?php
namespace App\Filament\Resources\OrderResource\Pages;
use pxlrbt\FilamentActivityLog\Pages\ListActivities;
class ListOrderActivities extends ListActivities
{
protected static string $resource = OrderResource::class;
}
#Register the page
Add the page to your resource's getPages() method.
public static function getPages(): array
{
return [
'index' => Pages\ListOrders::route('/'),
'create' => Pages\CreateOrder::route('/create'),
'activities' => Pages\ListOrderActivities::route('/{record}/activities'),
'edit' => Pages\EditOrder::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]))
]);
#Adjust your model to log activities
class Order extends Model
{
use LogsActivity;
}
See https://spatie.be/docs/laravel-activitylog/v4/advanced-usage/logging-model-events for more information on the topic.
#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:
"require": {
"pxlrbt/filament-activity-log": "dev-fix/error-message as main-dev",
},
"repositories": [
{
"type": "path",
"url": "filament-activity-log"
}
]
Now, run composer update.
The author
Dennis, a Filament core-team member, is dedicated to delivering high-quality plugins for your Filament projects. He is a freelance full-stack developer who works on several Laravel projects either individually or as part of small teams. In his work, he utilizes both Livewire and Inertia.
From the same author
Translate Action
Translate your forms content with the click of a button.
Author:
Dennis Koch
Favicon
Easiest way to add favicons to your table and schemas
Author:
Dennis Koch
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight/Raycast like Command Palette to your Filament Panel.
Author:
Dennis Koch
Changelog
Render a changelog inside your panel based on your GitHub releases. Works with private repos.
Author:
Dennis Koch
Featured Plugins
A selection of plugins curated by the Filament team
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese