@php $pageTitle = trim($__env->yieldContent('title', 'Dashboard')); @endphp @php try { $siteTitle = \App\Models\Setting::get('site_title', \App\Models\Setting::get('app_name', config('app.name', 'MailPurse'))); $faviconPath = \App\Models\Setting::get('site_favicon'); $metaDescription = \App\Models\Setting::get('meta_description'); $metaKeywords = \App\Models\Setting::get('meta_keywords'); $siteMeta = \App\Models\Setting::get('site_meta'); } catch (\Throwable $e) { $siteTitle = config('app.name', 'MailPurse'); $faviconPath = null; $metaDescription = null; $metaKeywords = null; $siteMeta = null; } if (!is_string($siteTitle) || trim($siteTitle) === '') { $siteTitle = config('app.name', 'MailPurse'); } $brandingDisk = (string) config('filesystems.branding_disk', 'public'); $faviconUrl = null; if (is_string($faviconPath) && trim($faviconPath) !== '') { $faviconUrl = $brandingDisk === 'public' ? asset('storage/' . ltrim($faviconPath, '/')) : \Illuminate\Support\Facades\Storage::disk($brandingDisk)->url($faviconPath); } @endphp @if(is_string($metaDescription) && trim($metaDescription) !== '') @endif @if(is_string($metaKeywords) && trim($metaKeywords) !== '') @endif @if(is_string($faviconUrl) && trim($faviconUrl) !== '') @endif @if(is_string($siteMeta) && trim($siteMeta) !== '' && preg_match('/<\s*(meta|link|script|style|base|noscript)\b/i', $siteMeta)) @php $siteMetaSafe = ''; if (preg_match_all('/<\s*(meta|link|base)\b[^>]*\/?>/i', $siteMeta, $m1)) { $siteMetaSafe .= implode("\n", $m1[0]) . "\n"; } if (preg_match_all('/<\s*(script|style|noscript)\b[^>]*>.*?<\s*\/\s*\\1\s*>/is', $siteMeta, $m2)) { $siteMetaSafe .= implode("\n", $m2[0]) . "\n"; } $siteMetaSafe = trim($siteMetaSafe); @endphp @if($siteMetaSafe !== '') {!! $siteMetaSafe !!} @endif @endif {{ __($pageTitle) }} - {{ $siteTitle }} @php $fontFamily = \App\Models\Setting::get('admin_font_family', 'Inter'); $fontWeights = \App\Models\Setting::get('admin_font_weights', '400,500,600,700'); $fontWeightsUrl = preg_replace('/\s*,\s*/', ';', $fontWeights); $fontFamilyUrl = str_replace(' ', '+', $fontFamily); $googleFontsUrl = "https://fonts.googleapis.com/css2?family={$fontFamilyUrl}:wght@{$fontWeightsUrl}&display=swap"; @endphp @php try { $brandColor = \App\Models\Setting::get('brand_color', '#3b82f6'); } catch (\Throwable $e) { $brandColor = '#3b82f6'; } $brandColor = is_string($brandColor) ? trim($brandColor) : '#3b82f6'; if ($brandColor === '' || !preg_match('/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/', $brandColor)) { $brandColor = '#3b82f6'; } $brandHex = ltrim($brandColor, '#'); if (strlen($brandHex) === 3) { $brandHex = $brandHex[0] . $brandHex[0] . $brandHex[1] . $brandHex[1] . $brandHex[2] . $brandHex[2]; } $brandR = hexdec(substr($brandHex, 0, 2)); $brandG = hexdec(substr($brandHex, 2, 2)); $brandB = hexdec(substr($brandHex, 4, 2)); @endphp @vite(['resources/css/app.css', 'resources/js/app.js']) @stack('styles') @php $disableMainScroll = request()->routeIs('customer.ai-tools.email-text-generator'); $appLogo = null; @endphp

@yield('page-title', 'Dashboard')

@php $customer = auth('customer')->user(); $quotaUsed = 0; $quotaTotal = null; if ($customer) { $quotaTotal = $customer->groupLimit('sending_quota.monthly_quota'); if ($quotaTotal === null) { $fallbackQuota = (int) ($customer->quota ?? 0); $quotaTotal = $fallbackQuota > 0 ? $fallbackQuota : null; } $periodStart = now()->copy()->startOfMonth()->toDateString(); $periodEnd = now()->copy()->endOfMonth()->toDateString(); $quotaUsed = (int) (\App\Models\UsageLog::query() ->where('customer_id', $customer->id) ->where('metric', 'emails_sent_this_month') ->where('period_start', $periodStart) ->where('period_end', $periodEnd) ->value('amount') ?? 0); } $quotaUsedPercent = $quotaTotal ? min(100, round(($quotaUsed / $quotaTotal) * 100)) : 0; $quotaRemainingPercent = $quotaTotal ? max(0, 100 - $quotaUsedPercent) : 100; @endphp

Notifications

@if($unreadCount > 0) {{ $unreadCount }} unread @else Up to date @endif

@php $notifications = auth('customer')->check() ? auth('customer')->user()->notifications()->latest()->limit(10)->get() : collect(); @endphp @forelse($notifications as $notification)

{{ $notification->data['title'] ?? 'Notification' }}

@if(!empty($notification->data['message']))

{{ $notification->data['message'] }}

@endif

{{ $notification->created_at->diffForHumans() }}

@empty
No notifications yet.
@endforelse
@php $activeLocales = \App\Models\TranslationLocale::query() ->where('is_active', true) ->orderBy('code') ->get(['code', 'name']); $currentLocale = (string) app()->getLocale(); $currentLocale = trim($currentLocale) !== '' ? $currentLocale : 'en'; @endphp @if($activeLocales->count() > 1)
@foreach($activeLocales as $loc)
@csrf
@endforeach
@endif
Profile Account
@csrf
@php $success = session()->pull('success'); @endphp @if($success)
{{ $success }}
@endif @php $error = session()->pull('error'); @endphp @if($error)
{{ $error }}
@endif @php $warning = session()->pull('warning'); @endphp @if($warning)
{{ $warning }}
@endif @if($errors->any())
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @yield('content')
@stack('scripts')