PHPackages                             mindsize/laravel5-woocommerce - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. mindsize/laravel5-woocommerce

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mindsize/laravel5-woocommerce
=============================

WooCommerce API Client for Laravel 5

1.0.3(8y ago)41.1k[1 issues](https://github.com/Mindsize/laravel5-woocommerce/issues)MITPHPPHP ^7.0

Since Sep 18Pushed 8y ago3 watchersCompare

[ Source](https://github.com/Mindsize/laravel5-woocommerce)[ Packagist](https://packagist.org/packages/mindsize/laravel5-woocommerce)[ Docs](https://github.com/Mindsize/laravel5-woocommerce)[ RSS](/packages/mindsize-laravel5-woocommerce/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (5)Used By (0)

Laravel 5 WooCommerce API Client
================================

[](#laravel-5-woocommerce-api-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4b7aaf2fa22268bf4e2a6a43c1edff8595411d2dc051841ac70e97ea22313556/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4d696e6473697a652f6c61726176656c352d776f6f636f6d6d657263652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mindsize/laravel5-woocommerce)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Travis Build](https://camo.githubusercontent.com/1394f123387107316b1f44e2398ae984432e78a72fe9fc049f0a3935f0480772/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4d696e6473697a652f6c61726176656c352d776f6f636f6d6d657263652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Mindsize/laravel5-woocommerce)[![Total Downloads](https://camo.githubusercontent.com/ffe68d3df0657d2135b27ff939d7ceb4dc5f3fab203b3dfc90435fbc39162b2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696e6473697a652f6c61726176656c352d776f6f636f6d6d657263652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mindsize/laravel5-woocommerce)

A simple Laravel 5 wrapper for the [official WooCommerce REST API PHP Library](https://github.com/woothemes/wc-api-php) from Automattic.

Installation
------------

[](#installation)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require mindsize/laravel5-woocommerce
```

### Step 2: Publish configuration

[](#step-2-publish-configuration)

```
php artisan vendor:publish --provider="Mindsize\WooCommerce\ServiceProvider"
```

### Step 3: Customize configuration

[](#step-3-customize-configuration)

You can directly edit the configuration in `config/woocommerce.php` or copy these values to your `.env` file.

```
WC_STORE_URL=http://example.org
WC_CONSUMER_KEY=ck_your-consumer-key
WC_CONSUMER_SECRET=cs_your-consumer-secret
WC_VERIFY_SSL=false
WC_VERSION=v1
WC_WP_API=true
WC_WP_QUERY_STRING_AUTH=false
WC_WP_TIMEOUT=15
```

Examples
--------

[](#examples)

### Get the index of all available endpoints

[](#get-the-index-of-all-available-endpoints)

```
use WooCommerce;

return WooCommerce::get('');
```

### View all orders

[](#view-all-orders)

```
use WooCommerce;

return WooCommerce::get('orders');
```

### View all completed orders created after a specific date

[](#view-all-completed-orders-created-after-a-specific-date)

#### For legacy API versions

[](#for-legacy-api-versions)

(WC 2.4.x or later, WP 4.1 or later) use this syntax

```
use WooCommerce;

$data = [
    'status' => 'completed',
    'filter' => [
        'created_at_min' => '2016-01-14'
    ]
];

$result = WooCommerce::get('orders', $data);

foreach($result['orders'] as $order)
{
    // do something with $order
}

// you can also use array access
$orders = WooCommerce::get('orders', $data)['orders'];

foreach($orders as $order)
{
    // do something with $order
}
```

#### For current API versions

[](#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!≠

```
use WooCommerce;

$data = [
    'status' => 'completed',
    'after' => '2016-01-14T00:00:00'
    ]
];

$result = WooCommerce::get('orders', $data);

foreach($result['orders'] as $order)
{
    // do something with $order
}

// you can also use array access
$orders = WooCommerce::get('orders', $data)['orders'];

foreach($orders as $order)
{
    // do something with $order
}
```

### Update a product

[](#update-a-product)

```
use WooCommerce;

$data = [
    'product' => [
        'title' => 'Updated title'
    ]
];

return WooCommerce::put('products/1', $data);
```

### Pagination

[](#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)

```
use WooCommerce;

// assuming we have 474 orders in pur result
// we will request page 5 with 25 results per page
$params = [
    'per_page' => 25,
    'page' => 5
];

WooCommerce::get('orders', $params);

WooCommerce::totalResults(); // 474
WooCommerce::firstPage(); // 1
WooCommerce::lastPage(); // 19
WooCommerce::currentPage(); // 5
WooCommerce::totalPages(); // 19
WooCommerce::previousPage(); // 4
WooCommerce::nextPage(); // 6
WooCommerce::hasPreviousPage(); // true
WooCommerce::hasNextPage(); // true
WooCommerce::hasNotPreviousPage(); // false
WooCommerce::hasNotNextPage(); // false
```

### HTTP Request &amp; Response (Headers)

[](#http-request--response-headers)

```
use WooCommerce;

// first send a request
WooCommerce::get('orders');

// get the request
WooCommerce::getRequest();

// get the response headers
WooCommerce::getResponse();

// get the total number of results
WooCommerce::getResponse()->getHeaders()['X-WP-Total']
```

### More Examples

[](#more-examples)

Refer to [WooCommerce REST API Documentation](https://woocommerce.github.io/woocommerce-rest-api-docs) for more examples and documention.

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Forked from [pixelpeter/laravel5-woocommerce-api-client](https://github.com/pixelpeter/laravel5-woocommerce-api-client)
-----------------------------------------------------------------------------------------------------------------------

[](#forked-from-pixelpeterlaravel5-woocommerce-api-client)

Thanks Peter!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 68.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

4

Last Release

3152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c73026be0959f7f813fde9d1e313c7735aaea25b9107f18aac15cf3c30fbd150?d=identicon)[pmgarman](/maintainers/pmgarman)

---

Top Contributors

[![pixelpeter](https://avatars.githubusercontent.com/u/6502630?v=4)](https://github.com/pixelpeter "pixelpeter (37 commits)")[![pmgarman](https://avatars.githubusercontent.com/u/502720?v=4)](https://github.com/pmgarman "pmgarman (6 commits)")[![coenjacobs](https://avatars.githubusercontent.com/u/245703?v=4)](https://github.com/coenjacobs "coenjacobs (6 commits)")[![leeroyrose](https://avatars.githubusercontent.com/u/3706842?v=4)](https://github.com/leeroyrose "leeroyrose (1 commits)")[![palpalani](https://avatars.githubusercontent.com/u/716695?v=4)](https://github.com/palpalani "palpalani (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![ebisbe](https://avatars.githubusercontent.com/u/6747962?v=4)](https://github.com/ebisbe "ebisbe (1 commits)")[![jb000](https://avatars.githubusercontent.com/u/17474154?v=4)](https://github.com/jb000 "jb000 (1 commits)")

---

Tags

laravel-5-packagewoocommerce-apiwordpress-apiapilaravelwordpressrestwoocommerce

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mindsize-laravel5-woocommerce/health.svg)

```
[![Health](https://phpackages.com/badges/mindsize-laravel5-woocommerce/health.svg)](https://phpackages.com/packages/mindsize-laravel5-woocommerce)
```

###  Alternatives

[pixelpeter/laravel5-woocommerce-api-client

Laravel 5 wrapper for the Woocommerce REST API

125103.4k](/packages/pixelpeter-laravel5-woocommerce-api-client)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[illuminatech/data-provider

Allows easy build for DB queries from API requests

4413.3k](/packages/illuminatech-data-provider)[threesquared/laravel-wp-api

Laravel package for the Wordpress JSON REST API

1310.3k](/packages/threesquared-laravel-wp-api)[laragear/api-manager

Manage multiple REST servers to make requests in few lines and fluently.

161.8k](/packages/laragear-api-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
