Idempotency for HTTP requests,queued jobs, and arbitrary operations in Laravel.
truschery/idem
Run once. Reply forever.
HTTP Middleware
Attach the idempotent middleware to any route. Repeated requests with the same Idempotency-Key return the cached response — handler never runs twice.
HTTP Middleware →Job Middleware
Prevent queued jobs from executing more than once, even across retries. Pass a stable key and idem handles the rest — no traits or interfaces required.
Job Middleware →Facade
Wrap any arbitrary callback with Once::do(). Idempotency wherever you need it — inline in service classes, event listeners, or any application code.
Facade →