@php $path = request()->path(); $is = function (string $prefix) use ($path) { return str_starts_with($path, trim($prefix, '/')); }; $isMainLocation = (int) (session('location_id') ?? 0) === 1; $links = [ ['label' => 'Dashboard', 'url' => url('/accounting'), 'active' => $path === 'accounting', 'icon' => 'dashboard_btn.gif'], ['label' => 'Accounts', 'url' => route('accounts.index'), 'active' => request()->routeIs('accounts.*'), 'icon' => 'bank.gif'], ['label' => 'Daily Sales', 'url' => url('/accounting/daily-sales'), 'active' => $is('accounting/daily-sales'), 'icon' => 'sale_btn.gif'], ['label' => 'Expenses', 'url' => url('/accounting/expenses'), 'active' => $is('accounting/expenses'), 'icon' => 'exp_btn.gif'], ['label' => 'Transfer', 'url' => url('/accounting/transfers'), 'active' => $is('accounting/transfers'), 'icon' => 'exchange.png'], ['label' => 'Cheques', 'url' => url('/accounting/cheques'), 'active' => $is('accounting/cheques'), 'icon' => 'cheque.gif'], ['label' => 'Borrow/Lend', 'url' => url('/accounting/borrow-lend'), 'active' => $is('accounting/borrow-lend'), 'icon' => 'customer.gif'], ['label' => 'Recurring', 'url' => url('/accounting/recurring'), 'active' => $is('accounting/recurring'), 'icon' => 'report_btn.gif'], ['label' => 'History', 'url' => url('/accounting/history'), 'active' => $is('accounting/history'), 'icon' => 'report_btn.gif'], ]; if ($isMainLocation) { $links[] = ['label' => 'Genie', 'url' => route('accounting.terminal-api.edit'), 'active' => $is('accounting/terminal-api'), 'icon' => 'genie.gif']; } $links[] = ['label' => 'Off-POS', 'url' => route('accounting.offpos-clearance'), 'active' => $is('accounting/offpos-clearance'), 'icon' => 'sale_btn.gif']; @endphp