/laravel-sdk

Laravel package for NStack

Primary LanguagePHPMIT LicenseMIT

Laravel-sdk

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

📝 Introduction

An API wrapper for nstack.io API

📦 Installation

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"

⚙ Usage

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

Features

[x] Register php-sdk in laravel provider, with Facade and global func
[x] Translate provider for localization using laravels global func: trans(key)    

Link here

All PHP functionality can be found

Link

🏆 Credits

This package is developed and maintained by the PHP team at Monstarlab

📄 License

This package is open-sourced software licensed under the MIT license