@extends('layouts.admin') @section('title', 'Settings') @section('content')

Settings

Configure your {{ $appName }} installation.

{{-- ── Tab sidebar ── --}}
@foreach($groups as $key => $group) @php $isActive = $current === $key; @endphp {{ $group['label'] }} @if($isActive) @endif @endforeach
{{-- ── Settings form ── --}}
where('type','image')->count()) enctype="multipart/form-data" @endif> @csrf @method('POST')
{{-- Form header --}}
{{ $groups[$current]['label'] }} Settings
@php $descs = [ 'general' => 'Core platform configuration and company details.', 'email' => 'Configure SMTP settings for outgoing emails.', 'payment' => 'Set up payment gateways and billing preferences.', 'license' => 'Default rules and behaviour for license generation.', 'security' => 'API security, rate limiting, and fraud protection.', 'notifications' => 'Control which events trigger email notifications.', 'api' => 'API access, versioning, and webhook configuration.', ]; @endphp {{ $descs[$current] ?? '' }}
{{-- Settings fields --}}
@foreach($settings as $setting)
{{-- Label + Description --}}
@if($setting->description)

{{ $setting->description }}

@endif {{ $setting->key }}
{{-- Input --}}
@if($setting->type === 'boolean') @elseif($setting->type === 'textarea') @elseif($setting->type === 'password')
@elseif($setting->type === 'number') @elseif($setting->type === 'select') @php $options = match($setting->key) { 'app_timezone' => array_combine(timezone_identifiers_list(), timezone_identifiers_list()), 'default_currency' => ['USD'=>'USD - US Dollar','EUR'=>'EUR - Euro','GBP'=>'GBP - British Pound','CAD'=>'CAD - Canadian Dollar','AUD'=>'AUD - Australian Dollar','PKR'=>'PKR - Pakistani Rupee','INR'=>'INR - Indian Rupee'], 'mail_driver' => ['smtp'=>'SMTP','sendmail'=>'Sendmail','mailgun'=>'Mailgun','ses'=>'Amazon SES','log'=>'Log (Development)'], 'mail_encryption' => ['tls'=>'TLS (Port 587)','ssl'=>'SSL (Port 465)','null'=>'None'], 'payment_gateway' => ['manual'=>'Manual (Admin Only)','stripe'=>'Stripe','paypal'=>'PayPal'], default => [], }; @endphp @elseif($setting->type === 'image')
@if($setting->value)
{{ $setting->label }}
@endif

{{ $setting->value ? 'Upload a new file to replace the current image.' : 'No image uploaded yet.' }} Accepted: JPG, PNG, SVG, ICO — max 2 MB.

@else @endif
@endforeach
{{-- Footer actions --}}
{{ $settings->count() }} settings in this group
{{-- Email test button — uses fetch (NOT a nested form, which browsers ignore) --}} @if($current === 'email')
Send a test email to:
@endif
@endsection