PHP code example of evolvex / laravel-shadow-runtime
1. Go to this page and download the library: Download evolvex/laravel-shadow-runtime 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/ */
use Evolvex\ShadowRuntime\Contracts\ShadowOperation;
final class WithdrawalEligibilityV3 implements ShadowOperation
{
public function primary(mixed $input): mixed
{
return app(LegacyWithdrawalEligibility::class)->decide($input);
}
public function candidate(mixed $input): mixed
{
return app(NewWithdrawalEligibility::class)->decide($input);
}
}
$decision = Shadow::operation(WithdrawalEligibilityV3::class)
->input($snapshot)
->subject($snapshot->playerId)
->sample(25)
->run();