@php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
// ✅ MVP MENU ONLY
$menuItems = [
// Overview
[
'label' => 'Dashboard',
'icon' => 'bi bi-speedometer2',
'route' => 'dashboard',
],
// Master Data Registration
[
'label' => 'Master Data',
'icon' => 'bi bi-building',
'children' => [
['label' => 'Owners List', 'icon' => 'bi bi-people', 'route' => 'owners-list'],
['label' => 'Business List', 'icon' => 'bi bi-shop', 'route' => 'business.index'],
],
],
// Applications
[
'label' => 'Applications',
'icon' => 'bi bi-ui-checks',
'children' => [
['label' => 'Applications List', 'icon' => 'bi bi-card-list', 'route' => 'applications.index'],
[
'label' => 'Create Application',
'icon' => 'bi bi-plus-circle',
'route' => 'applications.create',
],
['label' => 'Renewals', 'icon' => 'bi bi-card-list', 'route' => 'applications.renewals'],
['label' => 'Amendments', 'icon' => 'bi bi-card-list', 'route' => 'applications.amendments'],
['label' => 'Retirement/Closure', 'icon' => 'bi bi-card-list', 'route' => 'applications.retirements'],
[
'label' => 'Endorsements (Health, Zoning, BFP, etc)',
'icon' => 'bi bi-card-list',
'route' => 'applications.endorsements',
],
],
],
// Assessment & Billing
[
'label' => 'Assessment',
'icon' => 'bi bi-calculator',
'children' => [
['label' => 'Assessments', 'icon' => 'bi bi-list-check', 'route' => 'assessments.index'],
['label' => 'Compute Fees', 'icon' => 'bi bi-cash-coin', 'route' => 'assessments.computefees'],
['label' => 'Fee Schedules', 'icon' => 'bi bi-table', 'route' => 'assessments.fees'],
],
],
// Receipts
[
'label' => 'Receipt',
'icon' => 'bi bi-cash-stack',
'children' => [
['label' => 'Post Payment', 'icon' => 'bi bi-journal-check', 'route' => 'receipt.postpayment'],
['label' => 'OR Register', 'icon' => 'bi bi-journal-text', 'route' => 'receipt.orregister'],
['label' => 'Void/Adjust', 'icon' => 'bi bi-slash-circle', 'route' => 'receipt.void'],
['label' => 'Cashier Shift / RCD', 'icon' => 'bi bi-slash-circle', 'route' => 'receipt.cashiershift'],
['label' => 'Deposits', 'icon' => 'bi bi-slash-circle', 'route' => 'receipt.deposits'],
],
],
// Permits
[
'label' => 'Permits',
'icon' => 'bi bi-badge-ad',
'children' => [
['label' => 'Permit List', 'icon' => 'bi bi-card-checklist', 'route' => 'permits.index'],
['label' => 'Issue/Release', 'icon' => 'bi bi-printer', 'route' => 'permits.releases'],
['label' => 'QR Verification', 'icon' => 'bi bi-qr-code-scan', 'route' => 'permits.verify'],
['label' => 'Re-issue/Reprint', 'icon' => 'bi bi-qr-code-scan', 'route' => 'permits.reprint'],
],
],
[
'label' => 'Billing',
'icon' => 'bi bi-receipt',
'children' => [
['label' => 'Invoices', 'icon' => 'bi bi-file-earmark-text', 'route' => 'billing.invoices'],
['label' => 'Unpaid / Aging', 'icon' => 'bi bi-hourglass-split', 'route' => 'billing.unpaid'],
],
],
// History
[
'label' => 'History',
'icon' => 'bi bi-clock-history',
'children' => [
['label' => 'Audit Trail', 'icon' => 'bi bi-activity', 'route' => 'history.audit'],
['label' => 'Business Ledger', 'icon' => 'bi bi-journal-richtext', 'route' => 'history.ledger'],
],
],
// Reports (basic)
[
'label' => 'Reports',
'icon' => 'bi bi-bar-chart',
'children' => [
['label' => 'Collections (Daily/Monthly)', 'icon' => 'bi bi-cash', 'route' => 'reports.collections'],
['label' => 'Master List', 'icon' => 'bi bi-list-ul', 'route' => 'reports.masterlist'],
['label' => 'Permits Issued', 'icon' => 'bi bi-check2-circle', 'route' => 'reports.issuedpermits'],
// ⛔ Delinquents (Phase 2)
],
],
// Admin
[
'label' => 'Administration',
'icon' => 'bi bi-gear',
'children' => [
['label' => 'Users & Roles', 'icon' => 'bi bi-shield-lock', 'route' => 'admin.users'],
['label' => 'Ordinance Config', 'icon' => 'bi bi-sliders', 'route' => 'admin.ordinance'],
['label' => 'Number Series (Control/OR/Permit)', 'icon' => 'bi bi-hash', 'route' => 'admin.series'],
['label' => 'Integration (BFP/Barangay)', 'icon' => 'bi bi-diagram-3', 'route' => 'admin.integrations'],
],
],
];
$slug = fn(string $label, int $i) => \Illuminate\Support\Str::slug($label) . '-' . $i;
// Inline active route logic
$isActive = function (?string $route, array $children = []): bool {
if ($route && request()->routeIs($route)) {
return true;
}
foreach ($children as $child) {
if (!empty($child['route']) && request()->routeIs($child['route'])) {
return true;
}
}
return false;
};
@endphp