@php $authUser = Auth::user(); $isSuperAdmin = $authUser && ((string) $authUser->user_type === '1'); // Existing Activity Log route $activityRoute = $authUser && $authUser->user_type == 2 ? 'admin.proposal.activities' : 'admin.create-activity'; // Define menu items (existing Activity Log included) $menuItems = [ ['title' => 'Dashboard', 'icon' => 'bx-home-circle', 'url' => 'dashboard', 'route' => 'dashboard'], ['title' => 'Permissions', 'icon' => 'bx-shield-quarter', 'url' => 'permissions', 'route' => 'permissions.index'], ['title' => 'Company Targets', 'icon' => 'bx-target-lock', 'url' => 'company_planners', 'route' => 'company-planners.index'], ['title' => 'CRM', 'icon' => 'bx-user-voice', 'url' => 'crm', 'route' => 'crm.index'], ['title' => 'Employee Management', 'icon' => 'bx-group', 'url' => 'workers', 'route' => 'workers.index'], ['title' => 'Activity Log', 'icon' => 'bx-task', 'url' => 'activities', 'route' => $activityRoute], ['title' => 'Website Management', 'icon' => 'bx-globe', 'url' => 'pages', 'route' => 'pages.pages-listing'], ['title' => 'Project Management', 'icon' => 'bx-receipt', 'url' => 'projects', 'route' => 'projects.index'], ['title' => 'Invoice Management', 'icon' => 'bx-receipt', 'url' => 'proposals', 'route' => 'proposals.index'], ['title' => 'MOM', 'icon' => 'bx-calendar-event', 'url' => 'meeting-invitations', 'route' => 'meeting-invitations.index'], ['title' => 'Accounts', 'icon' => 'bx-wallet-alt', 'url' => 'assets', 'route' => 'assets.index'], ['title' => 'Service Enquiry', 'icon' => 'bx-phone-call', 'url' => 'meeting', 'route' => 'enquiries.callnow'], ['title' => 'Contact Enquiry', 'icon' => 'bx-envelope', 'url' => 'contacts', 'route' => 'contacts.index'], ['title' => 'CSF PRO', 'icon' => 'bx-lock', 'url' => 'isms', 'route' => 'isms.index'], ['title' => 'Locations', 'icon' => 'bx-map', 'url' => 'admin', 'route' => 'admin.geo.index'], ['title' => 'Appointments', 'icon' => 'bx-comment-detail', 'url' => 'admin', 'route' => 'admin.appointments.index'], ['title' => 'Meta', 'icon' => 'bx-tag', 'url' => 'admin', 'route' => 'seo.index'], ]; // Add Employee Activity Log only for employees if ($authUser && $authUser->user_type == 2) { $menuItems[] = [ 'title' => 'Employee Activity Log', 'icon' => 'bx-task', 'url' => 'employee_activities', 'route' => 'admin.activities', // points to admin/activities ]; } // Map URLs to group names for permission checks $toGroupName = [ 'dashboard' => 'Dashboard', 'permissions' => 'Permissions', 'company_planners' => 'Company Targets', 'locations' => 'Company Targets', 'channels' => 'Company Targets', 'crm' => 'CRM', 'workers' => 'Employee Management', 'employee_leaves' => 'Employee Management', 'employee_salaries' => 'Employee Management', 'attendance_logs' => 'Employee Management', 'activities' => 'Activity Log', 'activity_logs' => 'Activity Log', 'employee_activities' => 'Employee Activity Log', // ✅ new mapping 'pages' => 'Website Management', 'industries' => 'Website Management', 'solutions' => 'Website Management', 'clients' => 'Website Management', 'casestudies' => 'Website Management', 'blogs' => 'Website Management', 'teams' => 'Website Management', 'jobs' => 'Website Management', 'proposals' => 'Invoice Management', 'proforma_invoices' => 'Invoice Management', 'service_invoices' => 'Invoice Management', 'quick_invoices' => 'Invoice Management', 'renewal_items' => 'Invoice Management', 'minute_meetings' => 'MOM', 'assets' => 'Accounts', 'travel_requests' => 'Accounts', 'travel_expenses' => 'Accounts', 'callnow' => 'Service Enquiry', 'calllater' => 'Service Enquiry', 'sendmessage' => 'Service Enquiry', 'meeting' => 'Service Enquiry', 'contacts' => 'Contact Enquiry', ]; @endphp