superciety/elrond-sdk-laravel
A Laravel SDK for the Elrond (MultiversX) blockchain, providing ready-made tools to query accounts, send EGLD and ESDT tokens, manage wallets, and interact with smart contracts through a clean, framework-friendly API.
composer require peermehq/mx-sdk-laravel (verify the exact Packagist name against the repo's composer.json — the GitHub repo is PeerMeHQ/mx-sdk-laravel). Laravel package auto-discovery registers the service provider and facade, so no manual config/app.php edits are needed on Laravel 10+.php artisan vendor:publish --provider="PeerMe\\MxSdk\\MxSdkServiceProvider" (check the actual provider/tag in the README — tags vary between releases) and read config/mx-sdk.php before touching code. That file is the map: network selection, API/gateway endpoints, and default timeout/retry behaviour all live there.mainnet / devnet / testnet) via env rather than hardcoding, and always start on devnet. Keep the network in .env alongside the other MX settings so config:cache and per-environment deploys behave predictably.php artisan tinker. This validates credentials, endpoint, and network in under a minute without risking funds or burning gas on a malformed transaction.app(): resolve the SDK's network provider / account service through the container (constructor injection or a facade alias) so tests can swap it. Avoid static calls sprinkled through controllers — the package is a thin wrapper over the underlying PHP SDK, and the container is your only clean seam.WalletService. Never let the path default to something inside the project tree; a stray *.pem in a repo is the most common real-world incident with SDKs like this.Http::fake() with recorded responses is far more reliable than trying to mock the SDK's internal objects. Keep a small fixture set per network.composer.json and read the changelog on every bump. This package wraps an upstream PHP SDK, so a wrapper patch release can still pull transitive breaking changes.illuminate/* constraint was raised or narrowed, not that the API changed. Before upgrading, diff the composer.json constraints in the v2.3.0 and v3.0.0 tags. If you're on Laravel 10 or 11 and the new constraint drops your version, you cannot upgrade and should stay pinned to ^2.3. If you're already on 11/12, expect a near-zero-risk upgrade.composer why mx-sdk and composer outdated --direct are your friends here.(float) casts on amounts is a bug waiting to lose funds — keep amounts as strings/integers in the smallest denomination and convert only at the display boundary.while loops against the gateway are a common production hang.foreach over a user list. If you need N balances, look for a bulk endpoint before writing the loop.Http::fake failing loudly. If a request 404s in tests, log the actual URL — it's nearly always a trailing-slash or /v1 prefix difference between the configured endpoint and the SDK default. Dumping the resolved config in tinker settles it faster than reading the SDK source.How can I help you explore Laravel packages today?