spatie/activitylog
Laravel 5 user activity logging package by Spatie: records actions to a database table and optionally to Laravel’s log handler, with migration and facade support. Abandoned since 2016-06-28; use spatie/laravel-activitylog instead.
spatie/laravel-activitylog (a maintained fork), which supports Laravel 5.5+ and newer. This package should not be used in production unless maintaining a legacy Laravel 5.x app.activity_log table with columns for log_name, properties, created_at, etc. Integration requires:
Creating, Updating events).eloquent.* events) to trigger logs. Requires minimal boilerplate for basic use.illuminate/support:v5.0).laravel-activitylog (the maintained fork) would require re-implementation of custom logic.spatie/laravel-activitylog or another modern alternative (e.g., laravel-auditlog, owen-it/audit-trails).laravel-activitylog) with a timeline.illuminate/support (Laravel core).monolog/monolog for log handler integration.composer require spatie/activitylog.php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider".protected $dispatchesEvents = [...]).laravel-activitylog ASAP.spatie/laravel-activitylog (maintained fork).Activity::log() vs. older syntax).Model::dispatchesEvents in favor of $dispatchesEvents array. This package may not work without patches.single, daily).phpunit/phpunit@^5.7 for testing.User) to test schema and event triggers.laravel-activitylog within 6–12 months.doctrine/dbal < 2.13).composer require doctrine/dbal:^3.0).activity_log table).laravel-activitylog issues for similar problems.Activity::log('custom_event', [...]), ensure the fork supports it.activity_log(created_at, log_name).DB::transaction().SELECT * on large tables. Use:
Activity::where('log_name', 'order.created')->latest()->limit(100);
// app/Console/Commands/ArchiveActivityLogs.php
Activity::where('created_at', '<', now()->subMonths(6))->each(function ($log) {
// Export to S3/backup
});
tenant_id column to activity_log.Activity::where('tenant_id', auth()->tenant()->id).| Failure Scenario | Impact | Mitigation |
|---|---|---|
How can I help you explore Laravel packages today?