@php use Illuminate\Support\Facades\DB; /** * Account Setup Logic * Checks if templates and SMTP settings exist for the logged-in company */ $templateExists = DB::table('templates') ->where('company_id', $global_company->company_id) ->where('is_delete', 'No') ->where('template_draft','No') ->exists(); $smtpExists = DB::table('smtp_configs') ->where('company_id', $global_company->company_id) ->exists(); // Notification flags $showTemplateAlert = !$templateExists; $showSmtpAlert = !$smtpExists; // Calculate Progress (2 steps total) $totalSteps = 2; $completedSteps = 0; if ($templateExists) $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
Notification
{{-- Account Setup Progress Bar --}} @if($progressPercentage < 100)
Account Setup Progress {{ number_format($progressPercentage) }}%
@endif