gnikyt / laravel-shopify

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

after install i am getting below error #470

Closed sunilit42 closed 3 years ago

sunilit42 commented 4 years ago

BadMethodCallException Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed()

Can you please help me on this?

jasperpoppe commented 4 years ago

Which version of the package are you using? Make sure your "Shop" model is refering to \App\User and that this model has soft delete.

Also, a bit dirty, but when you got this error, just go back to the base url and everything is working 🙈 (That was my temporary solution at least)

sunilit42 commented 4 years ago

Hello,

Using version ^11.4 for osiset/laravel-shopify ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)

i m new into laravel but checking into App\User model

sunilit42 commented 4 years ago

Hello,

image

now getting above error

jasperpoppe commented 4 years ago

Make sure your url is whitelisted for your app. You can whitelist this in your Partner Account => Apps => Name of your app => App Setup => Urls => Whitelisted redirection URL(s).

Add over there your urls like:

https://localhost/
https://localhost/authenticate
sunilit42 commented 4 years ago

do i need to add API details into config file as well?

gnikyt commented 4 years ago

@jasperpoppe Is correct. You need to add those URLs to your app config in partners dashboard.

You do not need to plug these values into .env or config/shopify-app.php, as the default fallbacks use this anyways.

Have you resolved your issue?

yrk2yrk commented 4 years ago

I managed to get it working by changing

$shop = $this->shopQuery->getByDomain($shopDomain, [], true); to $shop = $this->shopQuery->getByDomain($shopDomain, [], false);

in AuthorizeShop.php

joeainsworth commented 4 years ago

@sunilit42 how did you solve the original error? I am also getting this after a fresh install of laravel and this package.

gnikyt commented 4 years ago

Changing to false will not make re-installs correctly work.

yrk2yrk commented 4 years ago

Yes, I changed back that true. There were some other issues. Now it is working fine. Thanks.

dhruv728462 commented 4 years ago

BadMethodCallException Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed()

Can you please help me on this?

How did you manage to resolve this? I am also getting this error.

gordonchanhk commented 4 years ago

@sunilit42 I encountered this when I didn't perform migration and database setup. So you need to sort out the migration part first. Hope this helps.

tom-rice commented 4 years ago

I encountered this when I forgot to update User.php as per the installation guide under Models 'You will need to modify your Laravel user model.'

rajdeeptayde commented 3 years ago

Hello there i am also getting this error can you please help ,

Illuminate\Database\Eloquent\Builder::throwBadMethodCallException vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50

The app was running properly this error encountered after i added the following library caseyamcl/guzzle_retry_middleware