gunharth / laravel-lightspeed-api by gunharth

A Laravel wrapper for the Lightspeed Seoshop API
16,916
4
3
Package Data
Maintainer Username: gunharth
Maintainer Contact: hello@gunharth.io (Gunharth Randolf)
Package Create Date: 2016-11-29
Package Last Update: 2017-05-11
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:00:16
Package Statistics
Total Downloads: 16,916
Monthly Downloads: 11
Daily Downloads: 0
Total Stars: 4
Total Watchers: 3
Total Forks: 3
Total Open Issues: 0

Laravel 5 Lightspeed Seoshop API Wrapper

Latest Version on Packagist Software License StyleCI

This package makes working with the Lightspeed eCom 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(); // Note: by default the API spits out 50 items with a max of 250

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

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

// to change the API language
ShopApi::setApiLanguage('de');

Consult the Lightspeed eCom 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 Default API Language
     */
    'locale' => '',

];

Read the Lightspeed eCom 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.