php - Laravel Shopify Osiset: How do I use Osiset functions correctly?
I've been dealing with the
Laravel/Osiset-Shopify framework for some time and even after a long research there are things that I don't understand yet.
For example, if I want to fetch my webhooks, it is relatively cumbersome
There is a function
\osiset\laravel-shopify\src\ShopifyApp\Services\ApiHelper.php which I would much rather use.
I came across this documentation (https://osiset.com/laravel-shopify/classes/Osiset.ShopifyApp.Services.ApiHelper.html) from Osiset, for which I don't know how to use it.
I tried to load the service
use Osiset\ShopifyApp\Services\ApiHelper; and get the output data
dd(ApiHelper::getWebhooks());. However, I get the error message
Non-static method Osiset\ShopifyApp\Services\ApiHelper::getWebhooks() cannot be called statically.
$foo = new ApiHelper; dd( $foo->getWebhooks() );
did not lead to any result:
Call to a member function rest() on null.
Can someone show me how to access Osiset's internal functions and use the documentation properly?
You can use this documentation (https://github.com/osiset/laravel-shopify/wiki)
and for the webhooks.json, You can use this to get the results $userId will be the user's primary key.
$shop = User::find($userId); $method = 'GET'; $url = '/admin/api/2021-04/webhooks.json'; return $shop->api()->rest($method, $url, );
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.