Getting started
Usage
Actions
Besides the form and infolist components, the package also ships with a ready-made action that displays a record's timeline in a modal slideover, so you can use it directly in your pages and tables.
Timeline action
You can use the RalphJSmit\Filament\Activitylog\Filament\Actions\TimelineAction action in your pages and tables to display a button that will open the timeline of the record in a modal slideover:
class EditPost extends EditRecord
{
// ...
public function getHeaderActions(): array
{
return [
RalphJSmit\Filament\Activitylog\Filament\Actions\TimelineAction::make(),
];
}
}
$table
->recordActions([
RalphJSmit\Filament\Activitylog\Filament\Actions\TimelineAction::make()
]);
Of course, you can chain any of the methods available on the default action component to tweak the action to your liking.
The timeline in the slide-over is displayed using an infolist Timeline component. You can customize the component by passing a callback to the modifyTimelineUsing() method:
TimelineAction::make()
->modifyTimelineUsing(function (Timeline $timeline) {
return $timeline->compact()->searchable();
}),