boukjijtarik/woo-reports
Composer 安装命令:
composer require boukjijtarik/woo-reports
包简介
Laravel Packageto fetch WooCommerce orders report
README 文档
README
Laravel package to fetch WooCommerce orders and items using Eloquent (no REST API), show them in a DataTable with Excel export, and auto-export if the result exceeds a threshold.
Requirements
- PHP >= 8.1
- Laravel 10/11/12
- Access to the WordPress/WooCommerce database
Install
composer require boukjijtarik/woo-reports
If discovery is disabled, register Boukjijtarik\\WooSales\\WooSalesServiceProvider::class in config/app.php.
Publish config (optional):
php artisan vendor:publish --tag=woo-sales-config
Publish views (optional):
php artisan vendor:publish --tag=woo-sales-views
Configure
.env overrides:
WOO_SALES_CONNECTION=mysql WOO_SALES_WP_PREFIX=wp_ WOO_SALES_ROUTE_PREFIX=woo-sales WOO_SALES_DIRECT_EXPORT_THRESHOLD=1500
If the WordPress DB is separate, define a connection in config/database.php and point WOO_SALES_CONNECTION to it.
Adjust meta keys in config/woo_sales.php if needed.
Use
Open:
/woo-sales
Filters: date range, order ID, order statuses. If total rows exceed threshold, it redirects to Excel export and shows a notice. Otherwise, a DataTable is shown with an Excel button.
Direct export example:
/woo-sales/export?date_from=2024-01-01&date_to=2024-12-31&statuses[]=completed
Data model (tables)
{prefix}posts(orders:post_type=shop_order){prefix}postmeta(order meta){prefix}woocommerce_order_items(order items){prefix}woocommerce_order_itemmeta(item meta){prefix}terms,{prefix}term_taxonomy (product_cat),{prefix}term_relationships(product categories)
Security
Routes use web middleware. To require login, publish config and set:
'middleware' => ['web', 'auth']
License
MIT
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-27