PHP code example of abdulsalam / laravel-operation-preview
1. Go to this page and download the library: Download abdulsalam/laravel-operation-preview 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/ */
abdulsalam / laravel-operation-preview example snippets
use Abdulsalam\OperationPreview\Facades\Operation;
$preview = Operation::preview(function () use ($player) {
app(PlayerService::class)->deletePlayer($player);
});
return $preview->toArray();
Operation::confirm($request->string('token')->toString(), function () use ($player, $service) {
return $service->deletePlayer($player);
});
final class CasinoGatewayPreviewInterceptor implements Interceptor
{
public function name(): string { return 'casino'; }
public function install(PreviewSession $session): void { /* replace gateway binding */ }
public function collect(PreviewSession $session): void { /* record effects */ }
public function restore(PreviewSession $session): void { /* restore original */ }
}