{{-- Reward Loyalty - Proprietary Software Copyright (c) 2025 NowSquare. All rights reserved. See LICENSE file for terms. PWA Head Component Purpose: Include PWA meta tags, manifest link, and service worker registration. Add this component in the section of your main layout. Usage: --}} @php use App\Services\SettingsService; $settingsService = app(SettingsService::class); $themeColor = $settingsService->get('pwa_theme_color', config('default.pwa_theme_color', '#4F46E5')); $backgroundColor = $settingsService->get('pwa_background_color', config('default.pwa_background_color', '#ffffff')); $shortName = $settingsService->get('pwa_short_name', config('default.pwa_short_name', 'Rewards')); // Get icon URLs from uploaded media or fallback - ensure absolute URLs $pwaSetting = \App\Models\Setting::where('key', 'pwa_app_name')->first(); $icon192Path = $pwaSetting?->getFirstMediaUrl('pwa_icon_192') ?: asset('icons/pwa-192.png'); $icon512Path = $pwaSetting?->getFirstMediaUrl('pwa_icon_512') ?: asset('icons/pwa-512.png'); // Ensure URLs are absolute (iOS requires absolute URLs) $icon192 = str_starts_with($icon192Path, 'http') ? $icon192Path : url($icon192Path); $icon512 = str_starts_with($icon512Path, 'http') ? $icon512Path : url($icon512Path); @endphp {{-- PWA Manifest --}} {{-- Theme Color - Used by browsers for toolbar/chrome --}} {{-- iOS/PWA Support --}} {{-- iOS Splash Screen - Use 512x512 PNG icon (iOS will display on white background) --}} {{-- Windows Tile --}} {{-- Service Worker Registration --}}