Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Standalone app with SSO shell, WordPress plugin connect flow, webhook ingest, fulfillment inbox, and plugin activation API — no payment processing. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Woo;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\WooOrder;
|
|
use App\Models\WooStore;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
public function index(Request $request): View
|
|
{
|
|
$user = $request->user();
|
|
$storeIds = WooStore::query()->where('user_id', $user->id)->pluck('id');
|
|
|
|
$stats = [
|
|
'stores' => WooStore::query()->where('user_id', $user->id)->where('status', WooStore::STATUS_ACTIVE)->count(),
|
|
'orders_new' => WooOrder::query()->whereIn('woo_store_id', $storeIds)->where('fulfillment_status', WooOrder::FULFILLMENT_NEW)->count(),
|
|
'orders_open' => WooOrder::query()->whereIn('woo_store_id', $storeIds)->whereNotIn('fulfillment_status', [
|
|
WooOrder::FULFILLMENT_DELIVERED,
|
|
WooOrder::FULFILLMENT_CANCELLED,
|
|
])->count(),
|
|
];
|
|
|
|
$recent = WooOrder::query()
|
|
->whereIn('woo_store_id', $storeIds)
|
|
->with('store')
|
|
->latest('created_at')
|
|
->limit(8)
|
|
->get();
|
|
|
|
return view('woo.dashboard', compact('stats', 'recent'));
|
|
}
|
|
}
|