mnpy / mnpy-laravel
There is no license information available for the latest version (v0.1.0) of this package.
Laravel wrapper for the PHP API SDK of MNPY.
v0.1.0
2018-03-18 16:39 UTC
Requires
- php: >=7.0
- mnpy/mnpy-php-api-sdk: v0.1.0
This package is not auto-updated.
Last update: 2024-05-26 03:01:30 UTC
README
Laravel 5 wrapper around the MNPY SDK
Requirements
- PHP >= 7.0
- A MNPY account
Installation
Add the package to the requirements of your composer file.
composer require mnpy/mnpy-laravel
Add the Service Provider to your config/app.php
(not applicable for Laravel 5.5 and higher)
MNPY\Laravel\MNPYServiceProvider::class
If you wish to use Facades instead of Dependency Injection you should add the following to your config/app.php
file.
'MNPYTransaction' => MNPY\Laravel\Facades\MNPYTransaction::class, 'MNPYPrice' => MNPY\Laravel\Facades\MNPYPrice::class 'MNPYToken' => MNPY\Laravel\Facades\MNPYToken::class
Now publish the config (or add MNPY_API_KEY
to your .env file)
php artisan vendor:publish --provider="MNPY\Laravel\MNPYServiceProvider"
Usage
This package serves as wrapper for mnpy/mnpy-php-api-sdk. Please refer to the original package for documentation regarding usage.
Depency Injection
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); } }
Facades
use MNPY\Laravel\Facades\MNPYTransaction; class Foo { protected $transaction; public function bar($transaction_id) { return MNPYTransaction::get($transaction_id); } }