PHP code example of vance-page / laravel-web3

1. Go to this page and download the library: Download vance-page/laravel-web3 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/ */

    

vance-page / laravel-web3 example snippets


use Vance\LaravelWeb3\Web3Facade;

Web3Facade::eth()->provider->execute(function ($err, $data) {
    //
});

use Vance\LaravelWeb3\Web3Facade;

Web3Facade::connection('http2')->eth()->provider->execute(function ($err, $data) {
    //
});

use Vance\LaravelWeb3\Web3Facade;

Web3Facade::eth(); // equivalent of $web3->eth
Web3Facade::net();  // equivalent of $web3->net
Web3Facade::personal();  // equivalent of $web3->personal
Web3Facade::shh();  // equivalent of $web3->shh
Web3Facade::utils();  // equivalent of $web3->utils

use Vance\LaravelWeb3\Web3Facade;

Web3Facade::contract($abi, 'latest')
    ->bytecode($bytecode)
    ->new($params, $callback);