Download the PHP package lara-igniter/activitylog without Composer
On this page you can find all versions of the php package lara-igniter/activitylog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lara-igniter/activitylog
More information about lara-igniter/activitylog
Files in lara-igniter/activitylog
Package activitylog
Short Description Log activity inside your Laraigniter app.
License MIT
Informations about the package activitylog
Laraigniter activity log
Auditable activity logging for Laraigniter applications. It uses Elegant\Database\Model\Model, CodeIgniter config groups, and the existing Laraigniter model-event arrays; it has no Laravel or Eloquent dependency.
Installation
Install the package:
Add the provider to config/hooks.php before application providers:
Publish and run the migration
The activity log table is required. Publish the package migration:
Then run the migration:
Publish the configuration (optional)
The package loads its bundled defaults automatically. Publish an editable application override only when needed:
The published config/activitylog.php is loaded after the package defaults and therefore overrides them. Use --force only when you intentionally want to overwrite an existing published file.
Log an activity explicitly
Pass a Laraigniter model instance and the persisted subject ID. The framework's read results are data objects, so the ID is explicit when logging from a model service/repository.
The authenticated Ion Auth user is attached automatically. Use causedBy() to supply another actor, or causedByAnonymous() to suppress it.
Automatically log model events
Use LogsActivity in an Model class and return its options:
The trait records created, updated, deleted, force_deleted, and restored events. deleted represents a soft delete; force_deleted represents a permanent deletion. For a single-record update, it captures the persisted row before the write and stores Laravel-style changes: new values under attribute_changes.attributes and previous values under attribute_changes.old. With logOnlyDirty(), unchanged attributes are excluded from both collections.
Polymorphic model context
For a logged model with polymorphic columns, declare the relationship prefix with logMorphs(). The type and ID are stored in the activity properties.polymorphic_relations collection, separately from the attribute changes.
Multiple relations are supported: ->logMorphs(['emailable', 'receiptable']). The activity-log UI can render every configured relation without model-specific conditions.
Query logs and retention
Cleanup command
Clean records older than the configured clean_after_days value:
Override the retention period or clean one named log only:
Delete every activity record explicitly, or every record in one named log:
--all permanently deletes matching activity records and cannot be combined with --days.
Set ACTIVITYLOG_ENABLED=false to stop persistence. The default configuration excludes password and remember_token; extend default_except_attributes for additional sensitive fields.
All versions of activitylog with dependencies
ext-json Version *
lara-igniter/enum Version ^1.0
lara-igniter/framework Version ^1.0