I am trying to get all the order list as a json in laravel using laravel5-woocommerce-api-client
and all i do it is

1.At first run composer require pixelpeter/laravel5-woocommerce-api-client ^2.0 to my laravel 5.4 project.

2.Second ,Add the Service Provider and Add the Facade

3.Publish configuration

  • In this step, Customize configuration, in config/woocommerce.php, i
    updated like this

  • ‘store_url’ => env(‘WOOCOMMERCE_STORE_URL’,
    http://localhost/ecommerceproject/‘),
    http://localhost/ecommerceproject(which is wordpress woocommerce
    url).

  • ‘consumer_key’ => env(‘WOOCOMMERCE_CONSUMER_KEY’,
    ‘ck_912993d84a43e821628f485a3bd94ad8101612ad’),

  • ‘consumer_secret’ => env(‘WOOCOMMERCE_CONSUMER_SECRET’,
    ‘cs_b71aebbfcc3cd7365da591a0faa0341a2e689edb’),

And then i created a controller which is PostController and
put the
use Woocommerce;and
public function index(){ return Woocommerce::get('orders'); }

It show the error like this

HttpClientException in HttpClient.php line 340:
Syntax error

Please guide me where am i missing the steps.
Thanks.

Read more here: How to get all the orders as a json in laravel using laravel5 woocommerce api client?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: