@extends('admin._layout') @section('title', 'إعدادات النظام') @push('head') @endpush @php // Group keys by section for clearer presentation. Anything not listed // here lands in "متفرقات" — keeps the page extensible without code edits // when new keys are added to SystemSetting::DEFAULTS. $sections = [ 'platform' => [ 'title' => 'المنصّة', 'icon' => 'building', 'keys' => ['platform_name', 'support_email', 'support_phone'], ], 'subscription' => [ 'title' => 'الاشتراكات والتجربة', 'icon' => 'credit-card', 'keys' => ['default_trial_days', 'expiration_grace_days', 'default_currency'], ], 'notifications' => [ 'title' => 'الإشعارات', 'icon' => 'bell', 'keys' => ['send_welcome_email', 'send_expiration_warning'], ], 'safety' => [ 'title' => 'الأمان والصيانة', 'icon' => 'shield', 'keys' => ['maintenance_mode'], ], ]; $known = collect($sections)->pluck('keys')->flatten()->all(); $other = collect($settings)->keys()->diff($known)->all(); if ($other) { $sections['other'] = ['title' => 'متفرقات', 'icon' => 'dots', 'keys' => $other]; } @endphp @section('content')
@csrf @foreach($sections as $sectionKey => $section)

{{ $section['title'] }}

@foreach($section['keys'] as $key) @php $s = $settings[$key] ?? null; @endphp @if($s)
{{ $s['key'] }} @if($s['is_default']) افتراضي @endif
{{ $s['description'] }}
@if($s['type'] === 'bool') @elseif($s['type'] === 'int') @else @endif
@endif @endforeach
@endforeach
@endsection