codexshaper / laravel-woocommerce
WooCommerce Rest API for Laravel
Installs: 108 961
Dependents: 0
Suggesters: 0
Security: 0
Stars: 197
Watchers: 14
Forks: 57
Open Issues: 52
Requires
- automattic/woocommerce: ^3.0
Requires (Dev)
- illuminate/support: ~5.5.40|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0
- phpunit/phpunit: ^7.0|^8.0|^9.3
- dev-master
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0
- v2.9
- v2.8
- v2.7
- v2.6
- v2.5
- v2.4
- v2.3
- v2.2
- v2.1
- v2
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0
- dev-analysis-wObJeK
- dev-analysis-a6ndOZ
- dev-analysis-5ZDGAl
- dev-analysis-x0pDBB
- dev-analysis-jL9y6J
- dev-analysis-x0NWyb
- dev-analysis-Vrx73g
- dev-analysis-Px74NY
- dev-analysis-3w7mw1
- dev-analysis-642lKM
- dev-analysis-WNpVmy
- dev-analysis-Rvj6kj
- dev-analysis-ajL5wk
- dev-analysis-NAmRJG
- dev-analysis-2Q7o2B
- dev-analysis-EAp0Ex
- dev-analysis-QMP2do
- dev-analysis-x0jWOb
This package is auto-updated.
Last update: 2024-12-05 13:37:58 UTC
README
Description
WooCommerce Rest API for Laravel. You can Get, Create, Update and Delete your woocommerce product using this package easily.
Authors
- Md Abu Ahsan Basir - github
License
- MIT license
- Copyright 2020 © CodexShaper.
Eloquent Style for Product, Customer and Order
// Where passing multiple parameters
$products = Product::where('title','hello')->get();
OR
// You can call field with where clause
$products = Product::whereTitle('hello')->get();
// Fields name are more than one words or seperate by underscore (_). For example field name is `min_price`
$products = Product::whereMinPrice(5)->get();
// Where passing an array
$orders = Order::where(['status' => 'processing']);
$orders = Order::where(['status' => 'processing', 'orderby' => 'id', 'order' => 'asc'])->get();
// Set Options
$orders = Order::options(['status' => 'processing', 'orderby' => 'id', 'order' => 'asc'])->get();
// You can set options by passing an array when call `all` method
$orders = Order::all(['status' => 'processing', 'orderby' => 'id', 'order' => 'asc']);
#Product Options: https://woocommerce.github.io/woocommerce-rest-api-docs/#products
#Customer Options: https://woocommerce.github.io/woocommerce-rest-api-docs/#customers
#Order Options: https://woocommerce.github.io/woocommerce-rest-api-docs/#orders
You can also use WooCommerce
Facade
use Codexshaper\WooCommerce\Facades\WooCommerce;
public function products()
{
return WooCommerce::all('products');
}
public function product( Request $request )
{
$product = WooCommerce::find('products/'.$request->id);
}
public function orders()
{
return WooCommerce::all('orders');
}
public function order( Request $request )
{
$order = WooCommerce::all('orders/'.$request->id);
}
public function customers()
{
return WooCommerce::all('customers');
}
public function customer( Request $request )
{
$customer = WooCommerce::all('customers/'.$request->id);
}
Use Facade Alias
use WooCommerce // Same as use Codexshaper\WooCommerce\Facades\WooCommerce;
use Customer // Same as use Codexshaper\WooCommerce\Models\Customer;
use Order // Same as use Codexshaper\WooCommerce\Models\Order;
use Product // Same as Codexshaper\WooCommerce\Models\Product;