1. Go to this page and download the library: Download karhal/web3-connect 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 use Karhal\Web3ConnectBundle\Model\Web3UserInterface;
//...
class User implements Web3UserInterface
{
//...
#[ORM\Column(type: 'string', nullable: true)]
private ?string $walletAddress;
public function getWalletAddress(): string
{
return $this->walletAddress;
}
public function setWalletAddress(string $wallet)
{
$this->walletAddress = $wallet;
}
}
namespace App\EventListener;
use Karhal\Web3ConnectBundle\Event\DataInitializedEvent;
class Web3LoginEventListener
{
public function onWeb3userDataInitialized(DataInitializedEvent $event)
{
$event->setData(['foo' => 'bar']);
}
}