hypervel / activity-log
Coroutine-safe activity logging for Hypervel applications.
0.4.x-dev
2026-12-01 12:51 UTC
Requires
- php: ^8.4
- hypervel/attributes: ^0.4
- hypervel/auth: ^0.4
- hypervel/collections: ^0.4
- hypervel/conditionable: ^0.4
- hypervel/config: ^0.4
- hypervel/console: ^0.4
- hypervel/container: ^0.4
- hypervel/context: ^0.4
- hypervel/contracts: ^0.4
- hypervel/coroutine: ^0.4
- hypervel/database: ^0.4
- hypervel/events: ^0.4
- hypervel/foundation: ^0.4
- hypervel/macroable: ^0.4
- hypervel/queue: ^0.4
- hypervel/support: ^0.4
- laravel/serializable-closure: ^2.0.11
- nesbot/carbon: ^3.13.1
- symfony/console: ^8.1.10
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
Replaces
None
This package is auto-updated.
Last update: 2026-12-03 12:06:32 UTC
README
Documentation: https://hypervel.org/docs/activity-log
Differences From Spatie Laravel Activity Log
- Use the
ActivityLogfacade in place of Spatie'sActivityfacade. The config file and Artisan command prefix useactivity-log, and environment settings useACTIVITY_LOG_. The global helper isactivity(). activity(null)selects the configured default. Empty string and"0"are distinct log names.useLog(null)andinLog(null)explicitly set a null name.- Automatic model logging uses the event's in-memory snapshot without another
subject query.
refreshBeforeLogging()provides an explicit, transaction-only refresh for database-generated values. - Dotted relation attributes retain the configured key even when traversal resolves a snake-case, camel-case, or dynamic-relation alias.
- The activity model's connection owns the write. Spatie can defer a write on another connection until the subject commits. Hypervel supports a separate activity database, but a rollback on the subject connection does not discard that activity. For atomic audit writes, disable buffering and use the same connection and transaction. For durable cross-database delivery, use an application outbox.
- Optional buffering is coroutine-scoped and flushes in bounded batches at request and job boundaries. If an insert fails, its attempted batch is discarded because retrying an ambiguous write can duplicate rows. Unattempted rows remain eligible to flush.
- The facade resolves a stateless
ActivityLogManager. Each fluent root call gets a fresh logger, and reusing a logger afterlog()starts a new activity even when the previous call failed or logging was disabled. - Register callbacks and macros at worker boot. Resolve request-specific values such as a batch UUID when the callback runs, since the same registration serves later requests. See Callbacks and Macros.
- Hypervel reads package settings through
ActivityLogConfiguration. Omitted top-level settings use package defaults. If you supply abuffergroup, include bothenabledandbatch_size. Explicitly settingactivity_modelorenabledto null is invalid. - Cleanup uses the model's configured created-at column and primary key to delete bounded batches. A custom model can record keyless activities, but the built-in cleanup action requires a primary key.
setLogStatus()is replaced byenableLogging(),disableLogging(), andwithoutLogging(). Tests reset callbacks throughflushState()rather than the upstream test-onlyclearBeforeLoggingCallbacks()alias.- This package cannot be installed alongside
spatie/laravel-activitylogbecause both packages provideactivity()and use the same default table.
Ported from: https://github.com/spatie/laravel-activitylog