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(which is wordpress woocommerce

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

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

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.

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


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: