@php $resolvePreviewImage = function ($value, $default) { if (empty($value)) { return $default; } if (\Illuminate\Support\Str::startsWith($value, ['http://', 'https://', 'data:'])) { return $value; } $normalizedValue = ltrim($value, '/'); $candidates = [$normalizedValue]; if (!\Illuminate\Support\Str::startsWith($normalizedValue, 'uploads/')) { $candidates[] = 'uploads/' . $normalizedValue; } if (!\Illuminate\Support\Str::startsWith($normalizedValue, 'storage/')) { $candidates[] = 'storage/' . $normalizedValue; } $candidates[] = 'assets/admin/images/' . $normalizedValue; foreach ($candidates as $candidate) { if (file_exists(public_path($candidate))) { return asset($candidate); } } return asset($normalizedValue); }; $websiteLogoValue = $settings->website_logo ?? null; $websiteLogoPreview = $resolvePreviewImage($websiteLogoValue, asset('assets/web/images/logo.svg')); $faviconValue = $settings->favicon ?? null; $faviconPreview = $resolvePreviewImage($faviconValue, asset('assets/web/images/logo.svg')); $generalFields = [ ['name' => 'website_name', 'type' => 'text', 'icon' => 'fal fa-globe'], ['name' => 'keywords', 'type' => 'text', 'icon' => 'fal fa-tags'], ['name' => 'meta_description', 'type' => 'text', 'icon' => 'fal fa-align-left'], ['name' => 'vat_value', 'type' => 'number', 'icon' => 'fal fa-percent', 'min' => 0, 'max' => 100], ]; $mailFields = [ ['name' => 'mail_driver', 'type' => 'text', 'icon' => 'fal fa-envelope-open-text'], ['name' => 'mail_host', 'type' => 'text', 'icon' => 'fal fa-server'], ['name' => 'mail_port', 'type' => 'number', 'icon' => 'fal fa-network-wired'], ['name' => 'mail_username', 'type' => 'text', 'icon' => 'fal fa-user'], ['name' => 'mail_password', 'type' => 'password', 'icon' => 'fal fa-lock-alt'], ['name' => 'mail_encryption', 'type' => 'text', 'icon' => 'fal fa-shield-check'], ['name' => 'mail_from_address', 'type' => 'email', 'icon' => 'fal fa-at'], ['name' => 'mail_from_name', 'type' => 'text', 'icon' => 'fal fa-signature'], ]; $contactFields = [ ['name' => 'site_phone', 'type' => 'tel', 'icon' => 'fal fa-phone-alt'], ['name' => 'site_email', 'type' => 'email', 'icon' => 'fal fa-envelope'], ['name' => 'site_address_ar', 'type' => 'text', 'icon' => 'fal fa-map-marker-alt'], ['name' => 'site_address_en', 'type' => 'text', 'icon' => 'fal fa-map-marker-alt'], ]; $socialFields = [ ['name' => 'whatsapp', 'type' => 'text', 'icon' => 'fab fa-whatsapp'], ['name' => 'instagram', 'type' => 'text', 'icon' => 'fab fa-instagram'], ['name' => 'twitter', 'type' => 'text', 'icon' => 'fab fa-x-twitter'], ['name' => 'facebook', 'type' => 'text', 'icon' => 'fab fa-facebook-f'], ]; @endphp
{{ __('settings.overview_note') }}