Download the PHP package herca/activity-log without Composer
On this page you can find all versions of the php package herca/activity-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download herca/activity-log
More information about herca/activity-log
Files in herca/activity-log
Package activity-log
Short Description Activity logging package for Laravel
License MIT
Informations about the package activity-log
Herca Activity Log
A lightweight Laravel package for recording model activity logs, both automatically and manually.
Features
- Automatic logging for
created,updated, anddeletedmodel events - Manual logging through a fluent
ActivityLoggerservice - Polymorphic relation between the logged model and activity entries
- Snapshot support for
attributes,changes, andoldvalues - Request correlation through
request_id - Optional actor tracking through
created_by - Configurable ignored attributes
Installation
Install the package with Composer in your Laravel application:
Register the service provider if your Laravel version does not support package auto-discovery.
Publish Assets
Publish the configuration:
Publish the migration:
Run migrations:
Basic Usage
Add the LogActivity trait to any Eloquent model you want to track.
Once attached, the model will automatically record activity for:
createdupdateddeleted
Manual Logging
You can also create manual activity entries using the helper:
If your model uses the provided contract/trait API, you can also log directly from the model:
Controlling Logging
You can enable or disable logging at runtime:
You can also manage ignored attributes:
Activity Model
The package stores logs with fields such as:
typesnapshotnoterequest_idrelated_idcreated_bycreated_at
Each activity entry belongs to a subject through a polymorphic relation.
Request ID Resolution
The package resolves request_id in this order:
get_request_id()helper when enabled- Request headers such as
X-Request-IdorX-Correlation-Id - Request attribute
request_id - A generated ULID or ordered UUID
Events
An ActivityLogged event is dispatched whenever a new activity record is stored. You can listen to this event to trigger notifications, auditing workflows, or downstream processing.
Notes
- Update the Composer package name in the installation example to match your published package.
- Review the config file after publishing to customize table name, model class, and ignored attributes.
License
This package is open-sourced under the MIT license.
All versions of activity-log with dependencies
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0