An API wrapper for nstack.io API
To install this package you will need:
- PHP 7.1+
Run
composer require nstack/laravel-sdk
or setup in composer.json
nstack/laravel-sdk: 1.0.x
In config/app.php
(Laravel) or bootstrap/app.php
(Lumen) you should replace Laravel's translation service provider
Illuminate\Translation\TranslationServiceProvider::class,
by the one included in this package:
NStack\ServiceProvider::class
Setup in config/app.php
'providers' =>
[
....
// Illuminate\Translation\TranslationServiceProvider::class
NStack\ServiceProvider::class
]
'aliases' =>
[
....
'NStack' => NStack\Facade::class,
]
Copy config over from vendor/nstack/config/nstack.php to project/config/nstack.php
php artisan vendor:publish --provider="NStack\ServiceProvider"
You can now call via facade, eg:
\NStack::getContinentsClient()->index()
or via global function
nstack()->getContinentsClient()->index()
or via integration with trans()
helper
echo trans('messages.welcome');
All the basic fuctionality can be found in the php-sdk
[x] Register php-sdk in laravel provider, with Facade and global func
[x] Translate provider for localization using laravels global func: trans(key)
All PHP functionality can be found
This package is developed and maintained by the PHP team at Monstarlab
This package is open-sourced software licensed under the MIT license