1. Go to this page and download the library: Download square1/laravel-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/ */
square1 / laravel-idempotency example snippets
// App\Services\ExampleUserIdResolver
namespace App\Services;
class ExampleUserIdResolver
{
public function resolveUserId()
{
// Implement custom logic to return the user ID
return session()->special_user_token;
}
}