garcia1901l/laravel-activity-lite
Lightweight MongoDB-backed activity logger for Laravel (7–12). Automatically tracks model create/update/delete, records the causer (user, artisan, queues), supports manual log entries, configurable events, and powerful querying with CLI filters and JSON/CSV export.
Observers or Model Events (depending on Laravel version) for automatic tracking. Minimal code changes required if models already extend ActivityLite\Traits\ActivityTrait.updating/saving events).mongodb/laravel-mongodb (v3.8+) and PHP MongoDB extension. Compatibility with existing MongoDB deployments (e.g., Atlas, self-hosted) needs validation.| Risk Area | Severity | Mitigation |
|---|---|---|
| MongoDB Dependency | High | Evaluate existing MongoDB infrastructure; test with production-like datasets. |
| Query Performance | Medium | Benchmark MongoDB queries vs. SQL alternatives; consider indexing strategies. |
| Laravel Version Drift | Medium | Pin Laravel/MongoDB versions in composer.json; test on CI for upgrades. |
| Observer Conflicts | Low | Audit existing model observers; use priority-based event listeners if needed. |
| Data Migration | High | Plan for backfilling historical data if adopting mid-project. |
laravel-auditlog)?posts, users) with minimal impact.replacer or custom scripts to populate historical data into MongoDB.updating).mongodb/laravel-mongodb v3.8+ and PHP extension v1.10+ are compatible with your MongoDB server version (e.g., 4.4+).config/database.php).mongodb/laravel-mongodb and PHP extension.php artisan vendor:publish) and customize:
php artisan activity-lite:install.ActivityTrait or manually bind observers for models.use Garcia1901l\LaravelActivityLite\Traits\ActivityTrait;
class Post extends Model {
use ActivityTrait;
}
queue:work job).$activities = \Garcia1901l\LaravelActivityLite\Facades\ActivityLite::query()
->whereModel('App\Models\Post')
->whereCauserId(auth()->id())
->get();
created_at, model_name).Observers in favor of events).activity-lite:list command to inspect logs.causer_id, model_type).wiredTiger cache tuning.How can I help you explore Laravel packages today?