asignua/filament-record-lock
Filament Record Lock adds optimistic record locking to Filament resources, preventing users from editing the same record simultaneously. It locks rows on edit, shows who's editing, and releases locks automatically, reducing conflicting saves in multi-user admin panels.
HasLocks trait to every model that should participate in pessimistic locking.UsesResourceLock to the page class. For modal edits, use UsesSimpleResourceLock instead.record-lock:prune in the app scheduler. This is the safety net for abandoned locks when navigator.sendBeacon release-on-leave does not fire.kenepa/resource-lock, then the package config for table/connection/heartbeat settings, then the HasLocks model trait and the Edit-page trait.UsesResourceLock to the Edit page. The package handles heartbeat renewal, lock release on leave, stale-page detection, and lock-guarded Edit-page actions.UsesSimpleResourceLock on the modal edit page/component. This gives the same lock lifecycle without the full-page resource behavior.RecordLockColumn to resource tables so support/admin users can see who currently holds a record lock.ReleaseLockAction for a single record and ReleaseLocksBulkAction for bulk cleanup from a table or admin workflow.takeOver() path and fires RecordLockTakenOver, which is the right hook for notifications, audit logs, or Slack alerts.RecordLockTakenOver to record who took over a lock and why, especially in regulated or multi-tenant apps.scopeManagerQuery() on the panel/resource. Without it, the manager is closed on tenant panels.kenepa/resource-lock: the package is API-compatible “where it makes sense.” Read the migration section before swapping traits/config, and verify table name, connection, and any custom actions.Example shape:
use HasLocks;
class Invoice extends Model
{
use HasLocks;
}
use UsesResourceLock;
class EditInvoice extends EditRecord
{
use UsesResourceLock;
}
For modal edits:
use UsesSimpleResourceLock;
class EditInvoiceModal extends EditRecord
{
use UsesSimpleResourceLock;
}
navigator.sendBeacon will not fire on crashes, hard network failures, or some browser terminations. Always run record-lock:prune on a schedule.#[Locked]; treat it as server-owned. Custom UI that tries to flip lock state manually will not work as expected.scopeManagerQuery() is implemented. That is the extension point.kenepa/resource-lock compatibility is intentional but scoped. Check the migration section for differences in config keys, trait names, and manager behavior before assuming a drop-in replacement.How can I help you explore Laravel packages today?