peerme / mx-sdk-laravel
MultiversX SDK for Laravel (written in PHP).
Fund package maintenance!
peermehq
Installs: 4 561
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 5
Open Issues: 0
Requires
- php: ^8.2
- illuminate/contracts: ^10.0 || ^11.0
- illuminate/support: ^10.0 || ^11.0
- kevinrob/guzzle-cache-middleware: ^5.1
- multiversx/mx-sdk-php: ^0.3.0
Requires (Dev)
- laravel/pint: ^1.8
- orchestra/testbench: ^8.0 || ^9.0
- pestphp/pest: ^2.4
- pestphp/pest-plugin-laravel: ^2.0
- spatie/pest-plugin-test-time: ^2.0
- dev-main
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.8
- v0.8.7
- v0.8.6
- v0.8.5
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2024-11-04 13:42:14 UTC
README
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.
Installation
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"
Usage
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
Calling the API
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());
Validation Rules
This package exposes the following Laravel Validation Rules.
MxAddressRule
– to validate a given address format:
[ 'address' => ['required', new MxAddressRule], ]
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.