1. Go to this page and download the library: Download farbcode/laravel-evm 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/ */
farbcode / laravel-evm example snippets
use Farbcode\LaravelEvm\Facades\Evm;
$abi = file_get_contents(storage_path('app/abi/MyContract.abi.json'));
$contract = LaravelEvm::at('0xYourContract', $abi);
// Read call
$balance = $contract->call('balanceOf', ['0xUser']);
// Write (async - enqueued on EVM_QUEUE default:evm-send, see https://laravel-evm.farbcode.net/basic-usage#writes-async-transactions for more information)
$jobId = $contract->sendAsync('transfer', ['0xRecipient', 100]);