Download the PHP package roberts/web3-laravel without Composer
On this page you can find all versions of the php package roberts/web3-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roberts/web3-laravel
More information about roberts/web3-laravel
Files in roberts/web3-laravel
Package web3-laravel
Short Description Protocol-first, chain-agnostic Web3 toolkit with native EVM JSON-RPC and signer for Laravel
License MIT
Homepage https://github.com/roberts/web3-laravel
Informations about the package web3-laravel
Web3 Laravel — protocol‑first, multi‑chain adapters with native EVM JSON‑RPC
This Laravel package provides a protocol‑first, chain‑agnostic toolkit to create wallets and interact with multiple chains via per‑protocol adapters. It includes a native EVM JSON‑RPC client and built‑in transaction signer (legacy + EIP‑1559). No web3.php dependency.
Supported blockchains
Web3 Laravel is chain‑agnostic with per‑protocol adapters and a router that picks the right one based on the wallet. High‑level support:
- EVM (Ethereum‑compatible): wallets, native transfers, ERC‑20 approve/transfer
- Solana: wallets, native SOL, SPL approve/transfer, SPL token deploy helper
- XRPL: wallets, server‑side IOU issuance flow (with optional auto‑trustline)
- Sui: wallets, native SUI transfers, Coin Factory token creation
- Bitcoin: wallets, transaction flow stubs
- Cardano: wallets; SDK‑first token mint flow with proxy/stub fallbacks
- Hedera: wallets; SDK‑first token create flow with proxy/stub fallbacks
- TON: wallets; Jetton deploy via SDK or sendBoc, with stub fallback
See the docs below for per‑chain details and configuration.
Token deployment (multi‑chain)
You can launch fungible tokens via a single, chain-agnostic API. See the full guide with per-chain details, configuration, and examples:
- docs/deploytokens.md — Deploying Fungible Tokens (Solana SPL, Sui Coin Factory, Hedera HTS, Cardano Native Assets, XRPL IOU, TON Jetton)
Docs
- docs/deploytokens.md — Multi‑chain token deployment guide
- docs/transactions.md — Transaction pipeline: prepare → submit → confirm
- docs/sdk-integrations.md — SDK‑first integrations for Hedera, Cardano, and TON
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
This is the contents of the published config file (defaults shown):
Usage (EVM example)
Eloquent-style helpers:
php use Roberts\Web3Laravel\Models\Wallet;
$signer = Wallet::find($signerWalletId); $tx = $signer->createFungibleToken([ 'protocol' => 'solana', // or use 'blockchain_id' to target a specific chain 'name' => 'Example', 'symbol' => 'EXM', 'decimals' => 9, 'initial_supply' => '1000000000', ]); // Track $tx->status and $tx->tx_hash; see docs/deploytokens.md
Wallet ownership (User model)
Wallets are owned by your application’s User model via a nullable owner_id foreign key.
You can also use the built-in ping command to verify connectivity:
Transactions & events
We provide a chain‑agnostic Transaction model with a fully async prepare/submit/confirm pipeline and lifecycle events. See the full guide for details, examples, and per‑protocol behavior:
- docs/transactions.md — Transactions: model, async pipeline, events, confirmations
Additional docs and examples
- Explore tests/ for end‑to‑end examples (wallets, adapters, transactions, events).
- See docs/deploytokens.md for token creation across chains and CLI usage.
Features - Core Functionality
RPC & Provider Management: The package should allow for easy configuration of the blockchain's RPC endpoint (like Base). It should handle the instantiation of the Web3 class and its provider, making it available throughout the Laravel application via a Facade or service container.
Wallet Management: A key feature is the ability to securely handle Ethereum wallets. The package should provide a method to:
Generate new wallets with the package's native key engines (secp256k1 and ed25519), without any web3.php dependency.
Encrypt and decrypt private keys using Laravel's built-in Crypt facade, ensuring private keys are never stored in plain text.
Manage multiple wallets, allowing the application to select a specific wallet for a transaction.
Transaction Execution: The package should provide methods for executing both state-changing and read-only functions. This includes:
Sending ETH: A simple method to send Ether from a Laravel-managed wallet to any address on the Base chain.
Calling Contract Functions: A fluent API for calling "view" or "pure" functions that don't modify the blockchain state.
Executing Contract Functions: A secure way to execute state-changing functions that require a signed transaction and gas. This method should handle the signing, nonce management, and broadcasting of the transaction.
Asynchronous Operations: All state-changing transactions are handled as queued jobs. Creating a Transaction model dispatches an event that enqueues a job (SubmitTransaction) to sign and broadcast, preventing the web application from blocking. The model is updated with status and tx_hash automatically.
Additional Features ABI Management: The package could include functionality to retrieve and cache ABIs from the database, block explorers, or local files, making it easy to interact with a contract without manually loading the ABI each time.
Event Listening: It could provide an event listener or a scheduled command to monitor for specific events emitted by a smart contract on the blockchain.
Unit Conversion: Helper functions for converting between different units of currency (like Wei, Gwei, and Ether) would be very useful.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Drew Roberts
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of web3-laravel with dependencies
ext-sodium Version *
ext-gmp Version *
illuminate/contracts Version ^12.0
simplito/elliptic-php Version >=1.0.12
spatie/laravel-package-tools Version ^1.16
tuupola/base58 Version ^2.0
kornrunner/keccak Version ^1.1