@vite(['resources/css/app.css', 'resources/js/app.js']) @livewireStyles @include('layouts.bs') @if (!Auth::user()) @yield('content') @else
@include('layouts.aside')

@yield('title', 'Dashboard')

@php // Get all notifications for user $notifications = \App\Models\Notification::getNotifications(Auth::id(), \App\Helpers\ApiHelper::getAuthRole(), 50, Auth::user()?->zone(), \App\Helpers\ApiHelper::getAuthState(), \App\Helpers\ApiHelper::getAuthUserDepartment())->sortByDesc('created_at'); // Collect completed indent (module) IDs $completedIndentIds = $notifications ->whereNotNull('completed_on') ->pluck('module_id') ->unique(); // Pending notifications (exclude completed indents) $pendingNotifications = $notifications ->whereNull('completed_on') ->whereNotIn('module_id', $completedIndentIds) ->take(3); // Completed notifications $completedNotifications = $notifications ->whereNotNull('completed_on') ->take(3); // Count (only pending, if needed for bell icon) $notificationCount = $pendingNotifications->count(); @endphp