Skip to content

Commit

Permalink
Merge pull request #4 from PeerMeHQ/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
michavie authored Feb 28, 2024
2 parents 3d84f2c + 009623b commit 4267a68
Show file tree
Hide file tree
Showing 21 changed files with 1,999 additions and 1,504 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1]
os: [ubuntu-latest]
php: [8.2, 8.3]
laravel: [10.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,40 @@ composer require peerme/mx-sdk-laravel
And publish the config file `config/multiversx.php` via

```bash
php artisan vendor:publish --provider="Peerme\MxLaravel\ServiceProvider" --tag="config"
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

- 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](https://github.com/PeerMeHQ/mx-sdk-php)
- Network Providers: [mx-sdk-php-network-providers](https://github.com/PeerMeHQ/mx-sdk-php-network-providers)

- 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 Peerme\MxLaravel\Multiversx;
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).
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"illuminate/contracts": "^9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0",
"kevinrob/guzzle-cache-middleware": "^4.0",
"peerme/mx-sdk-php": "^1.1.1",
"peerme/mx-sdk-php-network-providers": "^1.4.0"
"multiversx/mx-sdk-php": "^0.1"
},
"require-dev": {
"laravel/pint": "^1.8",
Expand All @@ -31,12 +30,12 @@
},
"autoload": {
"psr-4": {
"Peerme\\MxLaravel\\": "src"
"MultiversX\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Peerme\\MxLaravel\\Tests\\": "tests"
"MultiversX\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -52,7 +51,7 @@
"extra": {
"laravel": {
"providers": [
"Peerme\\MxLaravel\\ServiceProvider"
"MultiversX\\ServiceProvider"
]
}
},
Expand Down
Loading

0 comments on commit 4267a68

Please sign in to comment.