@php $mobileFooterUser = auth()->user(); $mobileFooterIsAgent = $mobileFooterUser?->can('agent') && $featureManager->isVisible('agent_program'); $mobileFooterIsMerchant = $mobileFooterUser?->can('merchant'); $mobileFooterPwa = app(\App\Http\Controllers\Frontend\PwaController::class); $mobileFooterTabFallback = [ 'label' => __('Wallet'), 'route' => 'user.wallet.index', 'params' => [], 'icon' => 'fa fa-wallet', 'active' => request()->routeIs('user.wallet.*'), ]; $mobileFooterResolveTab = static function (array $tab) use ($featureManager, $mobileFooterTabFallback): array { if (isset($tab['feature']) && ! $featureManager->isVisible($tab['feature'])) { $tab = $tab['fallback'] ?? $mobileFooterTabFallback; } if (isset($tab['feature']) && ! $featureManager->isVisible($tab['feature'])) { $tab = $mobileFooterTabFallback; } if (! isset($tab['action']) && (! isset($tab['route']) || ! \Illuminate\Support\Facades\Route::has($tab['route']))) { $tab = $mobileFooterTabFallback; } return $tab + ['params' => []]; }; $mobileFooterRoleTabs = match (true) { (bool) $mobileFooterIsAgent => [ [ 'label' => __('Agent'), 'route' => 'user.agent.index', 'icon' => 'fa fa-briefcase', 'active' => request()->routeIs('user.agent.*') && ! in_array(request('tab'), ['cash-in', 'counter-cashout', 'cash-out-requests'], true), ], [ 'label' => __('Cash In'), 'route' => 'user.agent.index', 'params' => ['tab' => 'cash-in'], 'icon' => 'fa fa-wallet', 'active' => request()->routeIs('user.agent.*') && request('tab') === 'cash-in', ], [ 'label' => __('Cash Out'), 'route' => 'user.agent.index', 'params' => ['tab' => 'counter-cashout'], 'icon' => 'fa fa-qrcode', 'active' => request()->routeIs('user.agent.*') && in_array(request('tab'), ['counter-cashout', 'cash-out-requests'], true), ], ], (bool) $mobileFooterIsMerchant => [ [ 'label' => __('Merchant'), 'route' => 'user.merchant.index', 'icon' => 'fa fa-store', 'active' => request()->routeIs('user.merchant.*'), ], [ 'label' => __('Pay Links'), 'route' => 'user.payment-links.index', 'icon' => 'fa fa-link', 'active' => request()->routeIs('user.payment-links.*'), 'feature' => 'payment_link', 'fallback' => $mobileFooterTabFallback, ], [ 'label' => __('Sales'), 'route' => 'user.transaction.index', 'params' => ['type' => 'receive_payment'], 'icon' => 'fa fa-chart-line', 'active' => request()->routeIs('user.transaction.*') && request('type') === 'receive_payment', ], ], default => [ [ 'label' => __('Wallet'), 'route' => 'user.wallet.index', 'icon' => 'fa fa-wallet', 'active' => request()->routeIs('user.wallet.*'), ], [ 'label' => __('QR Scan'), 'action' => 'qr-scan', 'icon' => 'fa fa-qrcode', 'active' => false, ], [ 'label' => __('History'), 'route' => 'user.transaction.index', 'icon' => 'fa fa-clock-rotate-left', 'active' => request()->routeIs('user.transaction.*'), ], ], }; $mobileFooterTabs = array_map($mobileFooterResolveTab, $mobileFooterRoleTabs); $mobileMoreAppName = $mobileFooterPwa->appName(); $mobileMoreAppIcon = $mobileFooterPwa->iconUrl('icon_192'); $mobileMoreWorkspace = $mobileFooterIsAgent || $mobileFooterIsMerchant ? null : [ 'label' => __('Switch workspace'), 'route' => 'user.wallet.index', 'icon' => 'fas fa-wallet', 'tone' => 'dark', 'sub' => __('Currently: Personal Wallet'), ]; @endphp {{-- ========================================================== | Mobile Bottom Tab Bar with center FAB -> Dashboard | Visible < 992px only. ========================================================== --}} @if(setting('pwa_enabled', true)) {{-- PWA install prompt for mobile user app pages. --}}
@endif {{-- More services bottom sheet --}}