Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Activity Log Laravel Package

escarter/activity-log

A lightweight Laravel package for tracking user activity. Log model events and custom actions to the database, then query recent activity to build audit trails, dashboards, or admin feeds with minimal configuration. Works with Eloquent models and is simple to install and extend.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The design is the standard Laravel audit-log shape: a polymorphic activity_log table (subject_type/subject_id, causer_type/causer_id, event, properties, batch_uuid, created_at), an opt-in trait that hooks Eloquent model events, and a fluent builder for manual/non-model events. It adds no infrastructure — no queue, no sidecar, no external service — so it inherits the app's existing DB, auth, backup, and access-control posture. For a monolith or a small number of Laravel services sharing one database, that is the correct fit and the cheapest defensible audit trail you can ship.

Integration feasibility. Mechanically low-effort: composer require, publish config + migration, php artisan migrate, add the trait to one model. The real work is not installation, it is the three product decisions the package does not make for you: which events are enabled per model, which attributes are captured (allow list, not deny list), and how the causer is resolved in unauthenticated contexts. Budget for those, not for the install.

Technical risk — and the dominant one is provenance, not code.

  • The package is unproven. 1 GitHub star, a 0.305 composite score, and a v1.0.1 release whose notes are literally just a changelog link. The supplied PM assessment describes this as "a mature, small-scope Laravel package at a stable 1.0" and treats the patch release as a buy signal. That claim is not supported by the repository signals and should be corrected in the decision record before anyone relies on it. A 1.0 version number is a self-assigned label, not evidence of adoption.
  • The API surface is a near-exact match for spatie/laravel-activitylog — same column names, same performedOn/causedBy/withProperties builder, same batch UUID concept. Most likely this is a fork or rename of it. That is simultaneously the biggest risk (you are one abandoned fork away from an unmaintained dependency) and the best mitigation (the migration cost to the upstream original is close to zero if the namespaces are compatible).
  • Empty release notes on a 1.0.x patch mean config-key renames, added columns, or trait signature changes could be hiding in the diff. Patch releases on young packages frequently carry exactly those.
  • Unknown supported-version matrix. Laravel/PHP compatibility is not stated in the supplied material.

Key questions to resolve before committing.

  1. Is this a fork of spatie/laravel-activitylog, and if so, what does it change and why not use upstream?
  2. Which Laravel and PHP versions are actually supported and tested? Is there CI?
  3. Are writes synchronous in-request, or deferrable to afterCommit/queue?
  4. Does a pruning/retention command exist, and is it scheduler-registerable?
  5. Is there a documented causer-resolution path for queued jobs and console commands?
  6. Who maintains it, and what is the response time on an issue?

Integration Approach

Stack fit. Laravel + Eloquent + relational DB, nothing exotic. It only fits cleanly if the audit trail is allowed to live in the primary database; if security or legal require tamper-evident or separately-resident storage, that is a compensating control you scope separately and this package does not provide it.

Migration path. Two entry points, both cheap:

  • From nothing / hand-rolled observers: the package replaces custom event plumbing. Write one migration to backfill nothing (history starts at adoption — say so explicitly to stakeholders, the absence of pre-adoption history is a recurring stakeholder surprise), and delete the ad-hoc observers after the pilot proves out.
  • From Spatie upstream: if the namespaces and config keys align, this is a composer.json swap plus a config/migration diff. Verify the exact class names rather than assuming — forks rename things.

Compatibility. Pin the exact version (1.0.1) in composer.json. Do not float a caret constraint on a 1-star package with opaque release notes. Verify the Laravel/PHP matrix in a throwaway branch before it touches a shared codebase.

Sequencing.

  1. Spike (days): install in a branch, migrate, instrument one high-value model (Invoice, Order, or User), log a single update end-to-end, and confirm subject_type, non-null causer_id, and a renderable properties payload.
  2. Prove the boundary: add a second model — this is what validates your per-model allow/deny attribute lists, which is where sensitive-data leaks actually happen.
  3. Decide the platform questions: synchronous vs. deferred writes, retention window registered in the scheduler on day one, PII redaction list, morph-map/alias strategy for subject_type (decide before you accumulate history; renaming an alias or moving a namespace orphans rows permanently).
  4. Build the query layer: a repository/scope around the activity model with filters for subject, causer, event, date range, and log name; paginate.
  5. Then, and only then, build the downstream features (admin feed, customer "recent changes", security alerting). Activity logging is an enabler story — it must land before its consumers, not alongside them.

Explicitly out of scope for v1: cross-service audit unification, event streaming, and tamper-evidence. If those are requirements, stop and re-scope.

Operational Impact

Maintenance. Assume bus factor of one. With 1 star and no release narrative, you are effectively adopting a package you may have to own. The good news: the surface is small (one table, one trait, one builder), and if it is a Spatie fork, the escape hatch is a namespace swap. Plan for the possibility of vendoring it and treating it as internal code — that is a legitimate outcome, but it should be a stated cost in the business case, not a discovery in month nine.

Support. No community to lean on, no Stack Overflow corpus under this name, no issue-tracker track record. Internal ramp-up comes from reading the published config, the migration, and the trait — three files — rather than from docs. Budget a day of one engineer's time to become the named owner and write a short internal runbook.

Scaling. The write path is the concern: one INSERT per logged mutation on the same database serving production traffic, plus index maintenance on subject_type/subject_id, causer_type/causer_id, and created_at. High-churn columns (last_seen_at, counters, updated_at) will generate a row per request if not excluded — a per-model configuration failure that shows up as a database growth problem, not a logging problem. Large properties JSON blobs slow both writes and scans; trim payloads rather than reaching for JSON indexes. The table grows monotonically — retention is a launch requirement, not a later optimization.

Failure modes to instrument against.

  • Silent no-ops: config disabled, table missing, stale config cache on a worker, trait not actually applied, or event not in the enabled list. Check in that order.
  • Null causer_id in background contexts: the single most common data-quality defect. Queued jobs, console commands, and scheduled tasks have no auth context. Attribute to the requesting user, not the worker, and assert non-null causers in tests for critical flows.
  • Sensitive-data bleed: per-model exclusion lists rot as columns are added. Use an allow list; re-audit whenever a model gains a credential-shaped field.
  • Transaction semantics: whether a rolled-back write still produces a log row depends on sync vs. afterCommit config. Verify explicitly under a rolled-back transaction if anything compliance-adjacent depends on it.
  • Orphaned history: morph-map alias changes and model namespace moves make old rows un-resolvable.
  • Upgrade hazard: never vendor:publish --force over a live config; publish to a temp path, diff against the package stub, and hand-write a follow-up migration.

Ramp-up. Low for any Laravel developer — trait plus builder is a familiar mental model. The skills that actually matter are the non-obvious ones: knowing that "no rows written" is a config/migration problem while "wrong rows written" is an attribute-list problem, and knowing to query the table directly in tinker filtered by subject ID and ordered by created_at as the first debugging step. Capture both in the runbook.

Recommendation. Conditional adopt, contingent on the provenance question. If this is a thin fork of spatie/laravel-activitylog, default to the upstream package — the integration cost is identical and the maintenance risk is strictly lower. If there is a specific reason to prefer this one, adopt it with the exact version pinned, a named internal owner, retention and redaction configured on day one, and a written exit path. In either case, correct the "mature, stable 1.0" framing in the existing PM assessment before it propagates into a funding or roadmap decision.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource