it-healer/laravel-ethereum
Composer 安装命令:
composer require it-healer/laravel-ethereum
包简介
A library for Laravel that allows you to create and manage the Ethereum cryptocurrency.
关键字:
README 文档
README
Laravel Ethereum Module is a Laravel package for work with cryptocurrency Ethereum, with the support ERC-20 tokens. It allows you to generate HD wallets using mnemonic phrase, validate addresses, get addresses balances and resources, preview and send ETH/ERC-20 tokens. You can automate the acceptance and withdrawal of cryptocurrency in your application.
Requirements
The following versions of PHP are supported by this version.
- PHP 8.2 and older
- Laravel 10 or older
- PHP Extensions: GMP, BCMath, CType.
Installation
You can install the package via composer:
composer require it-healer/laravel-ethereum
After you can run installer using command:
php artisan ethereum:install
And run migrations:
php artisan migrate
Register Service Provider and Facade in app, edit config/app.php:
'providers' => ServiceProvider::defaultProviders()->merge([ ..., \ItHealer\LaravelEthereum\EthereumServiceProvider::class, ])->toArray(), 'aliases' => Facade::defaultAliases()->merge([ ..., 'Ethereum' => \ItHealer\LaravelEthereum\Facades\Ethereum::class, ])->toArray(),
For Laravel 10 you edit file app/Console/Kernel in method schedule(Schedule $schedule) add:
$schedule->command('ethereum:sync') ->everyMinute() ->runInBackground();
or for Laravel 11+ add this content to routes/console.php:
use Illuminate\Support\Facades\Schedule; ... Schedule::command('ethereum:sync') ->everyMinute() ->runInBackground();
Examples
First you need to add Ethereum Nodes, you can register account in ANKR.COM get take HTTPS Endpoint with API key for Ethereum blockchain:
use \ItHealer\LaravelEthereum\Facades\Ethereum; Ethereum::createNode('My node', 'https://rpc.ankr.com/eth/{API_KEY}');
Second you need add Ethereum Explorer, you can register account in Etherscan.io API and take Endpoint with API key:
use \ItHealer\LaravelEthereum\Facades\Ethereum; Ethereum::createExplorer('My explorer', 'https://api.etherscan.io/api', '{API_KEY}');
You can create ERC-20 Token:
use \ItHealer\LaravelEthereum\Facades\Ethereum; $contractAddress = '0xdac17f958d2ee523a2206206994597c13d831ec7'; Ethereum::createToken($contractAddress);
Now you can create new Wallet:
use \ItHealer\LaravelEthereum\Facades\Ethereum; $wallet = Ethereum::createWallet('My wallet');
Custom derivation path
Different wallets use different BIP-44 paths. The path template is stored per wallet
(the {index} placeholder is replaced with the address index); the default is the
standard m/44'/60'/0'/0/{index} used by MetaMask and most software wallets, so
existing wallets and projects are not affected.
use \ItHealer\LaravelEthereum\Ethereum as EthereumCore; use \ItHealer\LaravelEthereum\Facades\Ethereum; // Ledger Live: m/44'/60'/{index}'/0/0 $wallet = Ethereum::createWallet('Ledger', derivationPath: EthereumCore::PATH_LEDGER_LIVE); // Ledger Legacy / MyEtherWallet: m/44'/60'/0'/{index} $wallet = Ethereum::createWallet('Old Ledger', derivationPath: EthereumCore::PATH_LEDGER_LEGACY); // Any custom template $wallet = Ethereum::createWallet('Custom', derivationPath: "m/44'/60'/1'/0/{index}");
The default template can be changed via config('ethereum.wallet.default_derivation_path').
Adaptive synchronization (touch)
Enable adaptive sync (ethereum.touch) so addresses are polled often while in use and rarely
while idle, instead of every run. An address is "active" for waiting_seconds after its last
touch_at (set on user/merchant activity); while active it syncs no more often than
fast_interval, while idle no more often than slow_interval.
// config/ethereum.php 'touch' => [ 'enabled' => true, 'waiting_seconds' => 1800, // stay "active" 30 min after last touch 'fast_interval' => 60, // while active: at most once per 60s 'slow_interval' => 3600, // while idle: at most once per hour (null = skip idle entirely) ],
Mark activity by updating touch_at when the wallet is used (GUI view, API call, unlock):
$address->update(['touch_at' => now()]); // or in bulk for a wallet: $wallet->addresses()->update(['touch_at' => now()]);
Defaults (fast_interval 0, slow_interval null) preserve the legacy behavior: active addresses
sync every run, idle ones are skipped. ethereum:address-sync --force bypasses the schedule.
Alchemy support
Alchemy can be used both as an RPC node and as a transaction-history explorer
(alchemy_getAssetTransfers), and for real-time deposits via Address Activity webhooks.
// RPC node + Alchemy explorer (drop-in alternative to Etherscan) Ethereum::createAlchemyNode(apiKey: 'YOUR_ALCHEMY_KEY', name: 'alchemy'); Ethereum::createAlchemyExplorer(apiKey: 'YOUR_ALCHEMY_KEY', name: 'alchemy');
The explorer is driver-based (ethereum_explorers.driver = etherscan_v2 | alchemy); the
sync, deposits and webhook handler are unchanged. The chain is taken from
config('ethereum.explorer.chain_id') (1 = mainnet, 11155111 = Sepolia).
Compute Units & load balancing
Every node/explorer request is metered in a credits counter (Compute Units) that resets monthly;
getNode()/getExplorer() pick the least-used one, spreading load and Alchemy CU spend. CU costs
come from ItHealer\LaravelEthereum\Services\Alchemy\ComputeUnits (override in
config('ethereum.compute_units')). Set ethereum.sync.track_outgoing=false to detect deposits only
and halve getAssetTransfers requests.
Real-time deposits (Address Activity webhooks)
ETHEREUM_ALCHEMY_NOTIFY_AUTH_TOKEN=your-notify-auth-token # dashboard → Webhooks → AUTH TOKEN ETHEREUM_ALCHEMY_WEBHOOK_ENABLED=true ETHEREUM_ALCHEMY_WEBHOOK_URL=https://your-app.com/ethereum/alchemy/webhook ETHEREUM_ALCHEMY_AUTO_SUBSCRIBE=true
php artisan ethereum:alchemy-setup --reconcile # create the webhook + subscribe existing addresses php artisan ethereum:alchemy-reconcile # sync watched-address list php artisan ethereum:confirm-deposits # mature confirmations (webhooks fire once)
Alchemy pushes a signed notification on incoming/outgoing activity; the package verifies the HMAC
signature and triggers a targeted AddressSync. Facade API: Ethereum::ensureAlchemyWebhook(),
subscribeAlchemyAddress(), unsubscribeAlchemyAddress(), reconcileAlchemyWebhook().
Custom development & contacts / Заказная разработка и контакты
EN — Need a new project built from scratch, or these modules integrated into your existing application? Contact the developer directly — custom development, module integration and ongoing support are available.
RU — Нужен новый проект «под ключ» или интеграция этих модулей в существующее приложение? Свяжитесь с разработчиком напрямую — доступны заказная разработка, интеграция модулей и поддержка.
- 🌐 Website / Сайт: it-healer.com
- ✈️ Telegram: @biodynamist · +90 551 629 47 16
- 📱 WhatsApp: +90 551 629 47 16
- 📧 Email: info@it-healer.com
- 🐛 Issues / Баг-репорты: GitHub Issues
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
it-healer/laravel-ethereum 适用场景与选型建议
it-healer/laravel-ethereum 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 116 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 07 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「ethereum」 「it-healer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 it-healer/laravel-ethereum 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 it-healer/laravel-ethereum 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 it-healer/laravel-ethereum 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bitcoin and Altcoin Payment Gateway for Magento 2 via CoinGate
Library for validation of cryptocoin wallets
Coinbase Commerce API library
Compralo PHP Library
ethereum eth heco erc20 trc20 web3 keysotre bip44 infura etherscan proxy api
Alfabank REST API integration
统计信息
- 总下载量: 116
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-23
