Hello Everyone,
I’ve installed the plugin osiset / laravel-shopify and I followed the instructions for installation.
Now, I received the following error when I call the api method:
Error
Call to undefined method stdClass::api()
My user model:
use Osiset\ShopifyApp\Contracts\ShopModel as IShopModel;
use Osiset\ShopifyApp\Traits\ShopModel;
class User extends Authenticatable implements IShopModel
{
use Notifiable, ShopModel;
...
My controller:
public function themeUpdate(ShopvoteShops $shopvoteShop, $request = null)
{
$user = DB::table('users')->first();
$shopvoteShop = ShopvoteShops::where('url', $user->name)->first();
$shop = Auth::user();
$response = $user->api()->rest('GET', '/admin/script_tags.json');
Basically, the instances User and Auth everytime are empty and I can’t call for example $shop->api(), because
Error
Call to a member function api() on null.
I will be glad to hear how to fix this issue.
Thank you!