amsgames / laravel-shop

Laravel shop package
MIT License
483 stars 166 forks source link

Class name must be a valid object or a string #67

Open ankitabhatti05 opened 5 years ago

ankitabhatti05 commented 5 years ago

I got an error of Class name must be a valid object or a string while I'm adding an item in the cart.

I am getting this error in ShopCartTrait of the add method

ankitabhatti05 commented 5 years ago

Hello, I solved it by changing return $this->belongsTo(Config::get('auth.model'), 'user_id'); to return $this->belongsTo(Config::get('auth.providers.users.model'), 'user_id'); in vendor\amsgames\laravel-shop\src\Traits\ShopCartTrait and it works.

ndhaked commented 5 years ago

share your personal mail id

On Tue, Nov 27, 2018 at 12:03 PM ankitabhatti05 notifications@github.com wrote:

Hello, I solved it by changing return $this->belongsTo(Config::get('auth.model'), 'user_id'); to return $this->belongsTo(Config::get('auth.providers.users.model'), 'user_id'); in vendor\amsgames\laravel-shop\src\Traits\ShopCartTrait and it works.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/amsgames/laravel-shop/issues/67#issuecomment-442034669, or mute the thread https://github.com/notifications/unsubscribe-auth/AcCnKZq8iuYkc_98c11nm-nFVkgF17ZSks5uzSojgaJpZM4Y1JQF .

--

RegardsNirbhay Singh Dhaked

Sr. Php Developer Konstant infosolutions pvt.ltd

Jaipur (Rajasthan) 302020Cont:- 9269967182

ankitabhatti05 commented 4 years ago

share your personal mail id On Tue, Nov 27, 2018 at 12:03 PM ankitabhatti05 @.**> wrote: Hello, I solved it by changing return $this->belongsTo(Config::get('auth.model'), 'user_id'); to return $this->belongsTo(Config::get('auth.providers.users.model'), 'user_id'); in vendor\amsgames\laravel-shop\src\Traits\ShopCartTrait and it works. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#67 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AcCnKZq8iuYkc_98c11nm-nFVkgF17ZSks5uzSojgaJpZM4Y1JQF . -- RegardsNirbhay Singh Dhaked Sr. Php Developer Konstant infosolutions pvt.ltd Jaipur (Rajasthan) 302020Cont:- 9269967182*

It's bhattiankita05@gmail.com