Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
189 stars 59 forks source link

Setup help #87

Closed iampapagray closed 1 year ago

iampapagray commented 1 year 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 1 year 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.