Download the PHP package obstechnologies/laravel5-woocommerce-api-client without Composer
On this page you can find all versions of the php package obstechnologies/laravel5-woocommerce-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download obstechnologies/laravel5-woocommerce-api-client
More information about obstechnologies/laravel5-woocommerce-api-client
Files in obstechnologies/laravel5-woocommerce-api-client
Package laravel5-woocommerce-api-client
Short Description Laravel 5 wrapper for the Woocommerce REST API
License MIT
Homepage https://github.com/pixelpeter/laravel5-woocommerce-api-client
Informations about the package laravel5-woocommerce-api-client
Laravel 5 WooCommerce API Client
A simple Laravel 5 wrapper for the official WooCommerce REST API PHP Library from Automattic.
Version overview
Laravel | wc-api-php used | Wordpress | Woocommerce | WC API version | use branch |
---|---|---|---|---|---|
5.7+ | 2.x | 4.4+ | 3.5+ | v1, v2, v3 | w.i.p. |
5.5+ | 1.3.x | 4.4+ | 3.0 - 3.4.x | v1, v2, v3 | ^3.0 |
5.4+ | 1.3.x | 4.4+ | 2.6 - 2.6.14 | v1, v2 | ^2.0 |
5.3 | 1.3.x | 4.1+ | 2.1 - 2.5.5 | legacy v1, legacy v2, legacy v3 | ^1.0 |
Installation
Step 1: Install Through Composer
For API Version v2, WooCommerce 3.0+, Wordpress 4.4+, php 7.0+, Laravel 5.5+ use the v3.x branch
For API Version v1, WooCommerce 2.6+, Wordpress 4.4+, Laravel 5.4+ use the v2.x branch
For older versions of Woocommerce starting from 2.1+ use the v1.x branch
Step 2: Add the Service Provider (not needed with v3.x)
Add the service provider in app/config/app.php
Step 3: Add the Facade (not needed with v3.x)
Add the alias in app/config/app.php
Step 4: Publish configuration
Step 5: Customize configuration
You can directly edit the configuration in config/woocommerce.php
or copy these values to your .env
file.
Examples
Get the index of all available endpoints
View all orders
View all completed orders created after a specific date
For legacy API versions
(WC 2.4.x or later, WP 4.1 or later) use this syntax
For current API versions
(WC 2.6.x or later, WP 4.4 or later) use this syntax.
after
needs to be a ISO-8601 compliant date!≠
Update a product
Pagination
So you don't have to mess around with the request and response header and the calculations this wrapper will do all the heavy lifting for you. (WC 2.6.x or later, WP 4.4 or later)
In some cases the web server returns headers only in lower case. This may cause errors when using the pagination functions. If that is your case, call the following method before calling any pagination methods.
HTTP Request & Response (Headers)
More Examples
Refer to WooCommerce REST API Documentation for more examples and documention.
Testing
Run the tests with:
License
The MIT License (MIT). Please see License File for more information.