@php use Illuminate\Support\Facades\DB; /** * Account Setup Logic * Checks if categories and SMTP settings exist for the logged-in company */ $categoryExists = DB::table('categories') ->where('company_id', $global_company->company_id) ->exists(); $smtpExists = DB::table('smtp_configs') ->where('company_id', $global_company->company_id) ->exists(); // Notification flags $showCategoryAlert = !$categoryExists; $showSmtpAlert = !$smtpExists; // Calculate Progress (2 steps total) $totalSteps = 2; $completedSteps = 0; if ($categoryExists) $completedSteps++; if ($smtpExists) $completedSteps++; $progressPercentage = ($completedSteps / $totalSteps) * 100; // Determine if the orange notification dot should be active // It shows if setup is incomplete OR you can add other custom logic here $hasSetupNotifications = ($progressPercentage < 100); @endphp