/laravel-lightspeed-api

A Laravel 5 wrapper around the Lightspeed Seoshop API

Primary LanguagePHPMIT LicenseMIT

Laravel 5 Lightspeed Seoshop API Wrapper

Software License StyleCI

This package makes working with the Lightspeed SeoShop API a breeze. Once installed you can perform all API calls like so:

use ShopApi;

// shop info
$shopInfo = ShopApi::shop()->get();

//retrieve all products
$products = ShopApi::products()->get(null, array('limit' => 200));

// with params
$products = ShopApi::products()->get(null, array('page' => 1, limit' => 100));

// product info with id
$productInfo = ShopApi::products()->get(1);

Consult the Lightspeed API docs for all of the API options.

Installation

Install the package via composer:

composer require gunharth/laravel-lightspeed-api

Next up the service provider must be registered:

'providers' => [
    ...
    Gunharth\Lightspeed\LightspeedServiceProvider::class,
];

Register the Gunharth\Lightspeed\LightspeedFacade Facade:

'aliases' => [
	...
    'ShopApi' => Gunharth\Lightspeed\LightspeedFacade::class,
    ...
]

Publish the configuration with this command:

php artisan vendor:publish --provider="Gunharth\Lightspeed\LightspeedServiceProvider"

This will publish file called lightspeed-api.php in your config-directory with this contents:

<?php

return [

    /*
     * Lightspeed cluser_id
     */
    'cluster_id' => '',

     /*
     * Lightspeed API key
     */
    'api_key' => '',

    /*
     * Lightspeed API secret
     */
    'api_secret' => '',

    /*
     * Lightspeed Locale
     */
    'locale' => '',

];

Read the Lightspeed API docs to learn on how to set the correct values and api keys.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.