From a50bd0c960fa60ddc7aa98e1ffe0cf81b98130f9 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 10 Feb 2026 16:53:28 +0700 Subject: [PATCH] feat: automatically select all user outlets for dashboard overview if only one outlet is available. --- app/Livewire/Studio/Dashboard/Overview.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Livewire/Studio/Dashboard/Overview.php b/app/Livewire/Studio/Dashboard/Overview.php index fc2a07a..d7076c9 100644 --- a/app/Livewire/Studio/Dashboard/Overview.php +++ b/app/Livewire/Studio/Dashboard/Overview.php @@ -51,6 +51,10 @@ public function render(): View { $outletIds = $this->selectedOutletIds; + if (count($this->outlets) === 1) { + $outletIds = auth()->user()->outlets()->pluck('outlets.id')->toArray(); + } + $todayOrder = Order::when(! empty($outletIds), fn ($q) => $q->whereIn('outlet_id', $outletIds)) ->today() ->count();