This SDK is a wrapper around the native mx-sdk-php to enable out-of-the-box support for Laravel applications.
Additionally, it comes with pre-configured MultiversX API Network Providers including caching mechanisms using the default Laravel cache driver.
You can install the package via composer:
composer require peerme/mx-sdk-laravel
And publish the config file config/multiversx.php
via
php artisan vendor:publish --provider="MultiversX\ServiceProvider" --tag="config"
Since this package wraps & configures the native packages for Laravel, you can access their utitlies without further configurations.
This includes:
- User Login Signature Verification
- MultiversX constants
- Domain Objects
- Blockchain-specific constants
- Other Utitilies & more
For more details, please refer to their documentation:
- Core: mx-sdk-php
- Network Providers: mx-sdk-php-network-providers
When instantiating the Network Providers, you can decide to optionally cache responses:
use MultiversX\Multiversx;
// retrieve fresh responses each time
$api = Multiversx::api();
// or retrieve cached responses subsequently for 1 hour
$api = Multiversx::apiWithCache(expiresAt: now()->addHour());
This package exposes the following Laravel Validation Rules.
MxAddressRule
– to validate a given address format:
[
'address' => ['required', new MxAddressRule],
]
composer test
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.