@extends('layouts.admin') @section('title', 'Settings — ' . ucfirst($group)) @push('styles') @endpush @section('content')
{{-- ── Sidebar Nav ───────────────────────────────────────── --}}

Setting Groups

@php $groupIcons = [ 'general' => ['icon'=>'sliders', 'label'=>'General'], 'currency' => ['icon'=>'coins', 'label'=>'Currency'], 'points' => ['icon'=>'star', 'label'=>'Points'], 'referral' => ['icon'=>'user-plus', 'label'=>'Referral'], 'fraud' => ['icon'=>'shield-halved', 'label'=>'Fraud'], 'payment' => ['icon'=>'credit-card', 'label'=>'Payment'], 'social' => ['icon'=>'share-nodes', 'label'=>'Social'], 'contact' => ['icon'=>'envelope', 'label'=>'Contact'], 'spin' => ['icon'=>'rotate', 'label'=>'Spin Wheel'], 'chat' => ['icon'=>'comments', 'label'=>'Chat'], 'purchase' => ['icon'=>'cart-shopping', 'label'=>'Purchase'], 'promote' => ['icon'=>'bullhorn', 'label'=>'Promotions'], ]; @endphp @foreach($groups as $g) @php $meta = $groupIcons[$g] ?? ['icon'=>'gear','label'=>ucfirst($g)]; @endphp {{ $meta['label'] }} @endforeach
{{-- Ghana Cedis helper --}} @if($group === 'currency')
💡 GHS / Ghana Cedis
Code: GHS  ·  Symbol: GH₵
Rate 0.001 = 1,000 pts → GH₵1
Rate 0.01  = 100 pts → GH₵1
Rate 0.1   = 10 pts → GH₵1
@endif {{-- Clear cache --}}
@csrf
{{-- Quick info cards --}}
💡 Tips
• Changes save immediately when you click Save.
• Settings with 🔑 are API keys — they are masked for security.
• After saving, click Clear Cache to apply changes site-wide.
• Boolean fields are ON/OFF toggles.
{{-- ── Settings Form ─────────────────────────────────────── --}}

{{ $groupIcons[$group]['label'] ?? ucfirst($group) }} Settings

{{ count($settings) }} fields
@csrf @method('POST') @if($errors->any())
{{ $errors->first() }}
@endif
@forelse($settings as $key => $setting) @php $label = $setting->label ?? ucwords(str_replace('_',' ',$key)); $hint = $setting->hint ?? null; $type = $setting->type ?? 'text'; $value = $setting->value ?? ''; $options = $setting->options ?? null; $isSens = $setting->is_sensitive ?? false; // Auto-detect sensitive fields by key name pattern if (!$isSens) { $sensPatterns = ['key','secret','token','password','pass','firebase','paystack','stripe','paypal','momo','admob']; foreach ($sensPatterns as $pat) { if (str_contains(strtolower($key), $pat)) { $isSens = true; break; } } } @endphp
{{ $label }} @if($isSens)  🔑@endif
{{ $key }}
@if($hint)
{{ $hint }}
@endif
{{-- Boolean toggle --}} @if($type === 'boolean') {{-- Textarea --}} @elseif($type === 'textarea') {{-- Number --}} @elseif($type === 'number') {{-- Select (JSON options) --}} @elseif($type === 'select' && $options) @php $opts = is_string($options) ? json_decode($options, true) : $options; @endphp {{-- Sensitive/masked text --}} @elseif($isSens)
{{-- Colour --}} @elseif($type === 'color')
{{-- Default text --}} @else @endif
@empty
No settings found for this group. Settings are seeded during installation.
@endforelse
@if(count($settings) > 0)
Last saved:
Discard
@endif
@endsection @push('scripts') @endpush