itmosoft / laravel-activity-timeline
Polymorphic activity feed and chronological event timeline for Laravel models, with actor attribution and structured properties.
Package info
github.com/ITMOSOFT/laravel-activity-timeline
pkg:composer/itmosoft/laravel-activity-timeline
v1.0.0
2026-11-17 10:11 UTC
Requires
- php: ^8.3
- illuminate/database: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5 || ^12.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A lightweight polymorphic activity feed for Laravel 12 and 13. Record chronological events against Eloquent models, attribute events to actors, and store structured properties.
Requirements
- PHP 8.3+
- Laravel 12 or 13
Installation
composer require itmosoft/laravel-activity-timeline php artisan vendor:publish --tag=itmosoft-activity-timeline-config php artisan migrate
Record an activity
use ItmoSoft\ActivityTimeline\Facades\ActivityTimeline; ActivityTimeline::record( subject: $order, event: 'status.changed', description: 'Order status changed to processing', causer: auth()->user(), properties: ['from' => 'pending', 'to' => 'processing'], );
Retrieve a timeline
$activities = ActivityTimeline::forSubject($order)->latest()->limit(20)->get();
Add the relationship to a model:
use ItmoSoft\ActivityTimeline\Concerns\HasActivityTimeline; class Order extends Model { use HasActivityTimeline; }
Then query $order->activities.
API
record(Model $subject, string $event, string $description, ?Model $causer = null, array $properties = [], ?DateTimeInterface $occurredAt = null): ActivityforSubject(Model $subject): BuilderforCauser(Model $causer): Builderlatest(): Builderoldest(): Builder
Configuration
Publish config/activity-timeline.php to change the table name:
return ['table' => 'activity_timeline'];
Scope and limitations
- Explicit application events only; no automatic model observers.
- This is an activity feed, not a replacement for
itmosoft/laravel-audit-log. - No admin UI, HTTP endpoints, notifications, retention scheduler, or export tools.
- Properties must be JSON-serializable. Avoid storing secrets or unnecessary personal data.
- Applications must enforce their own authorization for viewing activities.
Testing
composer install
composer test
MIT License. See LICENSE.