PHP code example of boaideas / laravel-shopify

1. Go to this page and download the library: Download boaideas/laravel-shopify 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/ */

    

boaideas / laravel-shopify example snippets


// config/app.php

'providers' => [
    ...
    BOAIdeas\Shopify\ShopifyServiceProvider::class,
];

// config/shopify.php

return [
    'api_key'       => env('SHOPIFY_KEY'),
    'api_secret'    => env('SHOPIFY_SECRET'),
    'shop_domain'   => env('SHOPIFY_DOMAIN'),
    'access_token'  => env('SHOPIFY_TOKEN'),
];

use RocketCode\Shopify\API as Shopify;

Route::get('/', function (Shopify $shopify) {

    $call = $shopify->call(
    [
        'URL' => 'products.json',
        'METHOD' => 'GET',
        'DATA' => [
            'limit' => 5,
            'published_status' => 'any'
        ]
    ]);

});

use Facades\RocketCode\Shopify\API as ShopifyAPI;

Route::get('/', function () {

    $call = ShopifyAPI::call(
    [
        'URL' => 'products.json',
        'METHOD' => 'GET',
        'DATA' => [
            'limit' => 5,
            'published_status' => 'any'
        ]
    ]);

});
bash
php artisan vendor:publish --provider="BOAIdeas\Shopify\ShopifyServiceProvider"