PHP code example of gunharth / laravel-lightspeed-api

1. Go to this page and download the library: Download gunharth/laravel-lightspeed-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gunharth / laravel-lightspeed-api example snippets


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');

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

'aliases' => [
	...
    'ShopApi' => Gunharth\Lightspeed\LightspeedFacade::class,
    ...
]
bash
php artisan vendor:publish --provider="Gunharth\Lightspeed\LightspeedServiceProvider"



return [

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

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

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

    /*
     * Lightspeed Default API Language
     */
    'locale' => '',

];