PHP code example of ademakanaky / laravel-enterprise-idempotency
1. Go to this page and download the library: Download ademakanaky/laravel-enterprise-idempotency library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ademakanaky / laravel-enterprise-idempotency example snippets
bash
php artisan vendor:publish --tag=idempotency-config
bash
php artisan vendor:publish --tag=idempotency-migrations
bash
php artisan migrate
php
Route::post('/payments', PaymentController::class)
->middleware('idempotency');
{=html}
<!-- -->
{=html}
<!-- -->
{=html}
<!-- -->
php
return [
'driver' => env('IDEMPOTENCY_DRIVER', 'hybrid'),
'ttl_minutes' => 60,
'status_codes' => [
200,
201,
202,
],
'lock' => [
'enabled' => true,
'seconds' => 10,
],
'idempotency_model' =>
\Ademakanaky\EnterpriseIdempotency\Models\IdempotencyRecord::class,
];