androsamp/filament-resource-lock
Record-level locking for Filament v5 edit pages: others instantly see who owns the lock, are blocked from accidental overwrite, and can request handoff. Includes optional audit history with per-field diff and selective rollback, plus polling or Laravel Echo push updates.
audit.max_entries_per_resource (default 500) and retention toggles, surface a decision product usually forgets: how much edit history do we keep, and is it a system of record or a convenience cache?save_and_unlock and ask_to_unblock are gated by named permissions with an escape hatch (null skips policy checks). This forces an explicit answer to "who is allowed to take a record away from someone else?" — a governance question, not just a UI one.en and ru only; if your admin panel serves other markets, translation work is an unbudgeted line item you can now see and price.Consider it when:
APP_URL realities.Look elsewhere (or build) when:
save() or afterCreate() with custom persistence. The README is explicit that the trait's wrapper is bypassed and you must call the bridge methods manually — and that no framework mechanism can fix this. Custom save flows (multi-step wizards, side-effecting saves, queued writes) raise integration cost and silent-audit-gap risk materially.lock_version column and a 409 conflict on stale saves is a few hours of work, has no shared state to operate, and never leaves a record locked because someone's laptop slept.window.Echo, no Reverb/Pusher, no private-channel auth. Broadcast mode is not a config toggle in practice; it is a project.en/ru, or per-field-level permissions, or non-Filament surfaces (public forms, API writes) — the package covers Filament EditRecord pages only.For executives (one paragraph): We have a recurring class of data-integrity incidents where two people edit the same record and one person's work is silently lost, plus a slow, engineering-dependent process for undoing bad edits. This MIT-licensed package closes both gaps inside our admin panel: it shows who is editing a record, blocks accidental overwrites, lets an editor formally request or hand off the record, and keeps a versioned history with per-field diffs and one-click restore of selected fields. Integration is a composer install, a migration, and two lines on each edit page — days, not weeks — and there is no license fee or vendor lock-in. The trade-off is a small, early-stage open-source dependency tied to Filament v5; we mitigate that with our own tests and a fork-ready posture, and the fallback (build a minimal lock table ourselves) is a known, bounded cost.
For engineering (what you're actually signing up for):
HasResourceLocks to models, InteractsWithResourceLock to EditRecord pages, HasResourceAudit to edit and create pages, and the table columns for lock state and creator.filament-resource-lock:install + migrate; it publishes config, migrations, an Echo bootstrap file, and injects an import into resources/js/bootstrap.js.heartbeat (polling, ~10s interval, zero new infra) or broadcast (Echo private channels, lower latency, new infra + window.Echo + correct APP_URL for the signed release route). Start with heartbeat; treat broadcast as a later optimization.ttl_seconds, release_grace_seconds, and stale_soft_release_ignore_seconds against real user behavior (tab close, sleep, SPA navigation). Defaults are a starting point, not a spec.save() or afterCreate() is overridden — call syncResourceAuditBeforeSave() / syncResourceAuditAfterSave() / syncResourceAuditAfterCreate() explicitly. Add a test that fails if an audit row is missing after a custom save path.HasAuditDiffPreview with an auditDiffPreviewUsing() callback for a readable diff; that callback renders trusted HTML — escape all user-controlled fragments.How can I help you explore Laravel packages today?