gnikyt / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
1.24k stars 374 forks source link

unable to get all products #459

Closed arslan308 closed 4 years ago

arslan308 commented 4 years ago
$shop = ShopifyApp::shop();
$requests = $shop->api()->rest('GET', '/admin/api/2019-07/products.json');

i am using these too use Osiset\ShopifyApp\Facades\ShopifyApp; use Osiset\ShopifyApp\Models\Shop;

error is 'Osiset\ShopifyApp\Facades\ShopifyApp' not found

Kyon147 commented 4 years ago

You need to use Auth::user->api()

arslan308 commented 4 years ago

@Kyon147 does this work or i have to ise osiset basic-shopify-api

awebartisan commented 4 years ago

If you are using v11.* of package, you need to use Auth::user()->api(), read more about it here: https://github.com/osiset/laravel-shopify/wiki/Usage

arslan308 commented 4 years ago

I am using 11.* let me try your method, will let you know soon @awebartisan

arslan308 commented 4 years ago

@awebartisan i am new to shopify app, can you please guide me, i am using this package osiset/laravel-shopify and also this osiset/basic-shopify-api, which one is best and proffessionaly used

awebartisan commented 4 years ago

BasicShopifyAPI package is a base package, its only purpose is to make Shopify API calls. Whereas, this is Laravel package, built on top of that BasicShopifyAPI package. They are meant to be used together and not separately.

gnikyt commented 4 years ago

@awebartisan Is correct.

/** @var \Osiset\ShopifyApp\Contracts\ShopModel $shop */
$shop = Auth::user();

$shop->api()->rest('GET', '/admin/products.json');

No need to pass version in the URL, use SHOPIFY_API_VERSION env for that... default its set to 2020-01.

arslan308 commented 4 years ago

solved