Download the PHP package sdkwala/laravel-activity-logger without Composer
On this page you can find all versions of the php package sdkwala/laravel-activity-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-activity-logger
Laravel Activity Logger
A Laravel package to log model events (created, updated, deleted) to a database table, with hybrid model registration.
Features
- ✅ Hybrid Model Registration: Use trait or config file to register models
- ✅ Event Logging: Log created, updated, and deleted events
- ✅ Flexible Configuration: Customize events and retention periods
- ✅ Cleanup Command: Remove old logs automatically
- ✅ Laravel 9, 10, 11, 12 Support: Compatible with multiple Laravel versions
- ✅ PHP 8.1+ Support: Modern PHP features
Installation
Publish Config & Migration
Usage
1. Using the Trait
Add the trait to any Eloquent model:
2. Using the Config File
List model class names in config/activity-logger.php:
3. Viewing Activity Logs
Cleanup Old Logs
Delete logs older than 30 days (default):
Or specify days:
Configuration
The configuration file config/activity-logger.php contains:
Database Schema
The activity_logs table contains:
id- Primary keymodel_type- Full class name of the modelmodel_id- ID of the model instanceevent- Event type (created, updated, deleted)old_values- JSON of previous values (for updates)new_values- JSON of new valuesuser_id- ID of the authenticated user (if any)created_at- Timestamp of the activity
Testing
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-activity-logger with dependencies
PHP Build Version
Package Version
The package sdkwala/laravel-activity-logger contains the following files
Loading the files please wait ...