Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PeerMeHQ/mx-sdk-laravel
MultiversX SDK for Laravel (written in PHP).
https://github.com/PeerMeHQ/mx-sdk-laravel
laravel multiversx sdk
Last synced: 4 months ago
JSON representation
MultiversX SDK for Laravel (written in PHP).
- Host: GitHub
- URL: https://github.com/PeerMeHQ/mx-sdk-laravel
- Owner: PeerMeHQ
- License: mit
- Created: 2021-10-07T22:12:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T12:13:03.000Z (7 months ago)
- Last Synced: 2024-10-20T11:51:46.117Z (4 months ago)
- Topics: laravel, multiversx, sdk
- Language: PHP
- Homepage: https://peerme.io
- Size: 746 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome-multiversx-dev-resources - MultiversX SDK for Laravel - MultiversX SDK for Laravel (written in PHP) (MultiversX community / SDKs and dev tools)
README
# MultiversX SDK for Laravel
[![Latest Version on Packagist](https://img.shields.io/packagist/v/PeerMe/mx-sdk-laravel.svg?style=for-the-badge)](https://packagist.org/packages/PeerMe/mx-sdk-laravel)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/PeerMeHQ/mx-sdk-laravel/tests.yml?style=for-the-badge&branch=main&label=Tests)](https://github.com/PeerMeHQ/mx-sdk-laravel/actions?query=workflow%3ATests+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/PeerMe/mx-sdk-laravel.svg?style=for-the-badge)](https://packagist.org/packages/PeerMe/mx-sdk-laravel)
[![](https://img.shields.io/twitter/follow/PeerMeHQ?color=%23555555&label=Follow%20PeerMe&logo=twitter&style=for-the-badge)](https://twitter.com/PeerMeHQ)
[![](https://dcbadge.vercel.app/api/server/sDeejyk3VR)](https://discord.gg/sDeejyk3VR)This SDK is a wrapper around the native [mx-sdk-php](https://github.com/PeerMeHQ/mx-sdk-php) to enable out-of-the-box support for [Laravel](https://laravel.com/) applications.
Additionally, it comes with pre-configured MultiversX API [Network Providers](https://github.com/PeerMeHQ/mx-sdk-php-network-providers) including caching mechanisms using the default Laravel cache driver.
## Installation
You can install the package via composer:
```bash
composer require peerme/mx-sdk-laravel
```And publish the config file `config/multiversx.php` via
```bash
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 & moreFor more details, please refer to their documentation:
- Core: [mx-sdk-php](https://github.com/PeerMeHQ/mx-sdk-php)
- Network Providers: [mx-sdk-php-network-providers](https://github.com/PeerMeHQ/mx-sdk-php-network-providers)### Calling the API
When instantiating the Network Providers, you can decide to optionally cache responses:
```php
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](https://laravel.com/docs/9.x/validation#available-validation-rules).
`MxAddressRule` – to validate a given address format:
```php
[
'address' => ['required', new MxAddressRule],
]
```## Testing
```bash
composer test
```## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Micha Vie](https://github.com/michavie)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.