Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
198 stars 57 forks source link

Setup help #87

Closed iampapagray closed 2 years ago

iampapagray commented 2 years ago

Hello, thanks for your work. I am trying to set this up for use in my project and i'm having some difficulty.. Here are the steps i used: composer require codexshaper/laravel-woocommerce php artisan vendor:publish --tag=woocommerce Then i added the credentials into .env.

I then import product like so: use Codexshaper\WooCommerce\Facades\Product;

But when i do this:= $prods = Product::all();

I get "Undefined type 'Codexshaper\WooCommerce\Facades\Product'."

Am I missing a step? Please help.

iampapagray commented 2 years ago

I've been able to get this working by importing use Codexshaper\WooCommerce\Models\Product;

Hope it helps someone else

Edit: Running composer dump-autoload also gets is working with the Facade as described in the documentation.