mintbridge/eloquent-auditing
Eloquent auditing for Laravel models that records create, update, and delete events with the changed attributes, old and new values, and the responsible user, so you can review a full, queryable history of every record directly from your database.
composer require mintbridge/eloquent-auditing — pin it ("0.0.5" exactly, not ^0.0.5). At 0.0.x the public API and schema are still moving.ip_address nullable, which is a schema change, not just a code change.use Auditable;-style trait on the Eloquent model alongside your existing traits). Start with one high-value model — an Invoice, Order, or User — rather than rolling it out everywhere at once.created / updated / deleted / restored), the migration stub (for the columns you'll be querying), and the CHANGELOG.md linked in the release notes.Request. Render that as a "history" tab on a detail page; it's the fastest way to prove value to stakeholders.setIpAddress(...)-style plumbing you added in your controllers or form requests. Fewer injection points, fewer places to get it wrong.ip_address became nullable. Treat "IP present" as an HTTP-only signal and design the UI accordingly (show — or "system" rather than an empty cell).assertDatabaseHas against the audit table with the model's morph columns) rather than on rendered history pages. Freeze time with Carbon::setTestNow() so the audit's timestamp is deterministic, and add one test that hits a real HTTP route and asserts an IP was recorded, plus one console/queued test that asserts it's null.auditable_type, auditable_id) and on created_at before you ship — the history tab will query by record and by date range, and the table grows faster than any other table in your schema.ip_address nullable change is the real story in this release. Two failure modes: (a) you upgraded the package but not your published migration, so writes without a request fail with a NOT NULL constraint violation; (b) you're changing the column on an existing install and need a proper ->nullable()->change() migration (plus doctrine/dbal on older Laravel). Diff the stub, don't assume.TrustProxies / TrustedProxy middleware is configured correctly. Verify with a request through your real edge, not from artisan serve.0.0.x means every release can break you. 0.0.5 already changed a column definition; assume a future release renames columns or moves the trait. Budget a read of the changelog per bump.password, remember_token, API keys, and card data will land in your audit table. Prefer excluding those attributes if the trait supports a hidden/except list; otherwise don't put the trait on those models at all. This is a compliance issue, not a cosmetic one.null in a worker instead of throwing on a missing request. v0.0.5's nullable column implies this is the intended path, but verify with a queued job before you rely on it.save() with no dirty attributes won't produce an update, and Model::query()->update() / raw SQL bypass Eloquent events entirely and will not be audited. That's the most common "why is my history empty" answer.0.0.x dependency is a maintenance trap.How can I help you explore Laravel packages today?