PHP code example of mnpy / mnpy-laravel

1. Go to this page and download the library: Download mnpy/mnpy-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mnpy / mnpy-laravel example snippets


MNPY\Laravel\MNPYServiceProvider::class

'MNPYTransaction' => MNPY\Laravel\Facades\MNPYTransaction::class,
'MNPYPrice' => MNPY\Laravel\Facades\MNPYPrice::class
'MNPYToken' => MNPY\Laravel\Facades\MNPYToken::class

use MNPY\SDK\Transaction;

class Foo {
    protected $transaction;

    public function __construct(Transaction $transaction) {
        $this->transaction = $transaction;
    }
    
    public function bar($transaction_id) {
        return $this->transaction->get($transaction_id);
    }
}

use MNPY\Laravel\Facades\MNPYTransaction;

class Foo {
    protected $transaction;

    public function bar($transaction_id) {
        return MNPYTransaction::get($transaction_id);
    }
}
sh
php artisan vendor:publish --provider="MNPY\Laravel\MNPYServiceProvider"