@extends('layouts.app') @section('title', __('dashboard.sidebar_settings')) @section('page_heading', __('dashboard.sidebar_settings')) @section('content') @php $s = fn($key) => $settings->where('key',$key)->first(); $sv = fn($key) => $settings->where('key',$key)->first()?->value ?? ''; @endphp {{-- Navigation --}} @if($type === 'general') @php $lang = $sv('default_language') ?: '—'; $tz = $sv('timezone') ?: '—'; $currency = $sv('system_currency') ?: '—'; @endphp {{-- KPIs --}}
@foreach([ ['fa-solid fa-language', '#eff6ff', '#2563eb', $lang, 'اللغة الافتراضية'], ['fa-solid fa-clock-rotate-left', '#f0fdf4', '#16a34a', $tz, 'المنطقة الزمنية'], ['fa-solid fa-coins', '#fffbeb', '#d97706', $currency, 'عملة النظام'], ['fa-solid fa-database', '#f8fafc', '#64748b', $settings->count(), 'إجمالي الإعدادات'], ] as [$ico,$bg,$color,$val,$lbl])
{{ $val }}
{{ $lbl }}
@endforeach
@csrf
{{-- Basic info --}}
البيانات الأساسية
@foreach([ ['site_name', 'اسم الموقع', 'text'], ['site_email', 'بريد الموقع', 'email'], ['contact_number', 'رقم التواصل', 'text'], ['tax_number', 'الرقم الضريبي', 'text'], ['timezone', 'المنطقة الزمنية', 'text'], ['default_language', 'اللغة الافتراضية', 'text'], ['system_currency', 'عملة النظام', 'text'], ] as [$key,$lbl,$inputType]) @php $setting = $s($key); @endphp @if($setting)
@if($setting->data_type === 'select') @elseif($setting->data_type === 'textarea') @else value) }}" {{ $setting->data_type==='password'?'placeholder="••••••••"':'' }}> @endif @error("settings.{$key}.value")
{{ $message }}
@enderror
@endif @endforeach {{-- Address --}} @php $addrSetting = $s('address'); @endphp @if($addrSetting)
@endif {{-- Logo + Favicon --}} @foreach(['site_logo'=>'شعار الموقع','site_favicon'=>'أيقونة الموقع'] as $key=>$lbl) @php $fileSetting = $s($key); @endphp @if($fileSetting)
@if($fileSetting->value && Storage::exists($fileSetting->value))
@endif
@endif @endforeach
{{-- Security --}}
الأمان والإشعارات
@foreach(['admin_pin'=>'رمز الإدارة (PIN)','system_manager_email'=>'إيميل مدير النظام','reservation_notification_emails'=>'إيميلات الإشعارات'] as $key=>$lbl) @php $setting = $s($key); @endphp @if($setting)
value) }}" {{ $setting->data_type==='password'?'placeholder="••••••••"':'' }}> @error("settings.{$key}.value")
{{ $message }}
@enderror
@endif @endforeach
{{-- Tips sidebar --}}
ملاحظات
@foreach([ ['fa-solid fa-envelope-circle-check','#f0fdf4','#16a34a','بريد الموقع','يُستخدم في الإشعارات والتنبيهات العامة.'], ['fa-solid fa-shield-halved','#fef2f2','#dc2626','رمز الإدارة','يُستخدم لاعتماد العمليات الحساسة.'], ['fa-solid fa-globe','#eff6ff','#2563eb','التوقيت واللغة','ينعكس على تنسيق التاريخ والوقت.'], ] as [$ico,$bg,$color,$title,$text])
{{ $title }}
{{ $text }}
@endforeach
@elseif($type === 'email') @php $mailHost = $sv('smtp_host') ?: '—'; $mailPort = $sv('smtp_port') ?: '—'; $mailEncryption = strtoupper($sv('smtp_encryption') ?: '—'); $mailFrom = $sv('mail_from_address') ?: '—'; @endphp {{-- KPIs --}}
@foreach([ ['fa-solid fa-network-wired', '#eff6ff', '#2563eb', $mailHost, 'خادم SMTP'], ['fa-solid fa-plug', '#f0fdf4', '#16a34a', $mailPort, 'المنفذ'], ['fa-solid fa-shield-halved', '#fffbeb', '#d97706', $mailEncryption, 'التشفير'], ['fa-solid fa-envelope', '#fef2f2', '#dc2626', $mailFrom, 'بريد المرسل'], ] as [$ico,$bg,$color,$val,$lbl])
{{ $val }}
{{ $lbl }}
@endforeach
{{-- SMTP form --}}
@csrf
إعدادات خادم SMTP
@foreach([ ['mail_mailer', 'نوع المحرك (Mailer)', 'text'], ['smtp_host', 'خادم SMTP (Host)', 'text'], ['smtp_port', 'المنفذ (Port)', 'number'], ['smtp_username', 'اسم المستخدم', 'text'], ['mail_from_address', 'إيميل المرسل', 'email'], ['mail_from_name', 'اسم المرسل', 'text'], ] as [$key,$lbl,$inputType]) @php $setting = $s($key); @endphp @if($setting)
value) }}"> @error("settings.{$key}.value")
{{ $message }}
@enderror
@endif @endforeach {{-- Encryption select --}} @php $encSetting = $s('smtp_encryption'); @endphp @if($encSetting)
@endif {{-- Password --}} @php $passSetting = $s('smtp_password'); @endphp @if($passSetting)
اترك فارغاً إذا لم ترد التغيير.
@endif
{{-- Test email --}}
{{ __('dashboard.Test Email') }}
@csrf
@error('test_email')
{{ $message }}
@enderror
{{-- Tips --}}
توصيات
@foreach([ ['fa-solid fa-network-wired','#eff6ff','#2563eb','خادم SMTP','تأكد من صحة المضيف والمنفذ قبل الحفظ.'], ['fa-solid fa-shield-halved','#fffbeb','#d97706','التشفير','استخدم TLS للمنفذ 587 وSSL للمنفذ 465.'], ['fa-solid fa-paper-plane','#f0fdf4','#16a34a','اختبار الإرسال','بعد الحفظ أرسل رسالة اختبار للتأكد.'], ] as [$ico,$bg,$color,$title,$text])
{{ $title }}
{{ $text }}
@endforeach
@elseif($type === 'invoice')
@csrf
{{-- Identity sidebar --}}
هوية الفاتورة
@foreach(['invoice_logo'=>'شعار الفاتورة','invoice_company_name'=>'اسم المنشأة','invoice_subtitle'=>'السطر التعريفي','invoice_cr_number'=>'رقم السجل التجاري','invoice_tax_number'=>'الرقم الضريبي'] as $key=>$lbl) @php $setting = $s($key); @endphp @if($setting)
@if($setting->data_type === 'file') @if($setting->value && Storage::exists($setting->value))
@endif @else value) }}"> @endif
@endif @endforeach
{{-- Content --}}
محتوى الفاتورة
@foreach(['invoice_phone'=>'رقم الهاتف','invoice_email'=>'البريد الإلكتروني','invoice_prefix'=>'بادئة رقم الفاتورة','invoice_footer'=>'نص التذييل'] as $key=>$lbl) @php $setting = $s($key); @endphp @if($setting)
value) }}">
@endif @endforeach @foreach(['invoice_iban'=>'رقم الآيبان (IBAN)','invoice_address'=>'العنوان','invoice_receipt_acknowledgment'=>'نص إقرار الاستلام','invoice_terms'=>'الشروط والأحكام'] as $key=>$lbl) @php $setting = $s($key); @endphp @if($setting)
@endif @endforeach
{{-- Toggles --}}
خيارات العرض
@foreach(['show_tax_number_on_invoice'=>'إظهار الرقم الضريبي','show_cr_number_on_invoice'=>'إظهار السجل التجاري','show_email_on_invoice'=>'إظهار البريد','show_address_on_invoice'=>'إظهار العنوان'] as $key=>$lbl) @php $setting = $s($key); @endphp @if($setting)
{{ $lbl }} value)==='1') class="settings-toggle__input">
@endif @endforeach
إدارة الفواتير
@endif @endsection