From c73885b5273998e665bc800a84f8a72ff5dc5a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Wed, 18 Dec 2024 20:08:13 +0100 Subject: [PATCH] wip --- src/Widgets/OrdersCount.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Widgets/OrdersCount.php b/src/Widgets/OrdersCount.php index 2309097e..ee3e54b2 100644 --- a/src/Widgets/OrdersCount.php +++ b/src/Widgets/OrdersCount.php @@ -5,6 +5,7 @@ use Cone\Bazar\Models\Order; use Cone\Root\Widgets\Value; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Http\Request; class OrdersCount extends Value { @@ -14,10 +15,12 @@ class OrdersCount extends Value protected ?string $icon = 'archive'; /** - * Create a new Eloquent query. + * {@inheritdoc} */ - public function query(): Builder + public function resolveQuery(Request $request): Builder { - return Order::query()->status(Order::FULFILLED); + $this->queryResolver = fn (): Builder => Order::query()->status(Order::FULFILLED); + + return parent::resolveQuery($request); } }