currentStore($request); $payload = $this->integrations->forStore($store); return view('woo.integrations.index', [ 'store' => $store, 'reachable' => $payload['reachable'], 'cached' => (bool) ($payload['cached'] ?? false), 'integrations' => $payload['integrations'], ]); } public function refresh(Request $request): RedirectResponse { $store = $this->currentStore($request); if ($store) { $this->integrations->forStore($store, refresh: true); } return redirect() ->route('woo.integrations.index') ->with('success', $store ? 'Integration status refreshed.' : 'Connect a store to refresh integration status.'); } public function sync(Request $request, string $integration): RedirectResponse { $store = $this->currentStore($request); $result = $this->integrations->syncCatalog($store, $integration); return redirect() ->route('woo.integrations.index') ->with($result['success'] ? 'success' : 'error', $result['message']); } }