Idempotent: An operation that produces the same result regardless of how many times it is executed. HTTP PUT and DELETE should be idempotent; POST is typically not. An idempotent operation gives the same result no matter how many times you run it. Setting a value to 5 is idempotent; adding 5 is not.
This matters because things get retried. A network timeout, a queue job that runs twice, a user double-clicking a button. If the operation is idempotent, a retry is harmless. If not, you might charge a customer twice or send the same email three times.
What should you keep in mind with Idempotent?
In HTTP, GET, PUT and DELETE are meant to be idempotent, while POST usually is not. For payments and other important POST requests, an idempotency key helps: the client sends a unique ID, and the server ignores repeats. Design background jobs, webhooks and deploy scripts to be safe to run twice. It is one of the cheapest forms of reliability.
Apply Spatie's Laravel and PHP coding standards for any task that creates, edits, reviews, refactors, or formats Laravel/PHP code or Blade templates; use for controllers, Eloquent models, routes, config, validation, migrations, tests, and related files to align with Laravel conventions and PSR-12.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.