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

Track Who Laravel Package

laravel-enso/track-who

Laravel Enso Track Who automatically records which users created, updated, or deleted Eloquent models. It provides traits and relationships for creator, updater, and deleter auditing, making it easy to track accountability across your Laravel application.

View on GitHub
Deep Wiki
Context7

Laravel Traits for tracking who's done what to your models

Frequently asked questions about Track Who
What is laravel-enso/track-who used for?
It is a small Laravel package that provides Eloquent traits for recording which user created, updated, or deleted a model. It stamps columns such as created_by, updated_by, and deleted_by through model events. It is best suited to attribution and accountability, not a full immutable audit log.
How do I install laravel-enso/track-who in a Laravel app?
Install it with Composer using composer require laravel-enso/track-who, then add nullable, indexed created_by, updated_by, and deleted_by columns to the tables you want to track. Apply the package's traits to the relevant Eloquent models and confirm the auth resolution matches your application. Because it is part of the Laravel Enso ecosystem, check that its conventions fit your app before rolling it out.
Which Laravel and PHP versions does laravel-enso/track-who support?
Support depends on the package's composer.json constraints, so check the Laravel and PHP bounds before committing. Small ecosystem packages often lag new framework releases, so verify compatibility with your app's major version. If you are on an older or newer Laravel release than the package targets, test in staging or consider a local trait instead.
Does laravel-enso/track-who work with soft deletes?
The deleted_by column only makes sense if you standardize on soft deletes, because a hard delete removes the row that would hold the attribution. Restores and force-deletes need explicit handling so the deleter value is cleared or preserved intentionally. Review your deletion semantics before adopting the trait, especially if some models use force deletes.
What happens when there is no authenticated user, such as in queues or console commands?
The package resolves the current user from the auth context, so console commands, queued jobs, seeders, and unauthenticated requests can produce null attribution. That is silent degradation: nothing fails loudly, but the audit data has gaps. Account for this in jobs and commands by explicitly setting an acting user or accepting nulls as part of your policy.
Does it track mass updates, upserts, or bulk operations?
No, Eloquent mass updates and upsert calls bypass model events, so those rows will not receive updated_by attribution. This is a coverage gap that can erode trust in the audit data if bulk jobs are common. Use query-builder updates carefully or add explicit attribution where bulk operations are unavoidable.
Can I use laravel-enso/track-who outside the Laravel Enso admin suite?
Technically yes: it is a small set of traits and observers that you can apply to ordinary Eloquent models. However, column naming, deletion semantics, and auth resolution assume Laravel Enso conventions, so standalone use means importing those conventions without the rest of the suite. For a single app it may be simpler to write a short trait and a test rather than add a dependency.
How does laravel-enso/track-who compare to spatie/laravel-activitylog?
track-who stamps who did what directly on the model row, while spatie/laravel-activitylog records discrete activity events, often with before and after data. track-who is lighter and narrower; activitylog is closer to a real audit trail with an immutable event log. Choose one owner for the concern rather than running both attribution systems on the same models.
How should I test that created_by, updated_by, and deleted_by are recorded correctly?
Write feature tests that act as a user, create, update, and soft-delete a model, and assert the three columns match the acting user. Add contract tests for unauthenticated contexts and queued or console paths to confirm the expected null behavior. Also test bulk updates if you use them, because those bypass model events and will not be attributed by the traits.
Is laravel-enso/track-who maintained and safe for production?
It has low blast radius because it only writes attribution columns and does not gate application behavior, but it also has thin adoption signals and a small maintainer base. Treat it more like a vendored snippet than a heavily supported dependency: pin the version, audit the small code surface, and be ready to fork or vendor it. If long-term maintenance matters, a local trait plus tests is a credible alternative.
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.
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
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console