Installation
Requirements
- PHP 8.1+
- Laravel 10+
- For Cache store: cache driver with atomic lock support (Redis recommended)
- For Database store: run migrations after installation
Install the Package
composer require truschery/idem
Publish the Config
php artisan vendor:publish --tag=idem-config
This will create config/idempotency.php in your application. See Configuration for all available options.
Database Store
If you plan to use the database store, publish and run the migrations:
php artisan vendor:publish --tag=idem-migrations
php artisan migrate
This creates the idempotency_keys table. See Stores for details on choosing between Cache and Database.
tip
Not sure which store to use? Start with the Cache store — it requires no migrations and works out of the box with Redis.