@extends('layouts/layoutMaster') @section('title', 'Settings') @section('content')

Settings

Settings
@if (session('success'))
{{ session('success') }}
@endif
@csrf @foreach($settings as $setting)
@php $label = ucwords(str_replace('_', ' ', $setting->key)); @endphp @if ($setting->type == 'checkbox' || $setting->type == 'boolean') @else @endif {{-- Text Type --}} @if ($setting->type == 'text') {{-- Textarea --}} @elseif ($setting->type == 'textarea') {{-- File Upload --}} @elseif ($setting->type == 'file') @if($setting->value !== null)

Current File: View

@endif {{-- Multiple File Uploads --}} @elseif ($setting->type == 'file_multiple') @if($setting->value !== null)

Current Files: @php $files = json_decode($setting->value, true) @endphp @foreach($files as $file) {{ $file }}
@endforeach

@endif {{-- Color Picker --}} @elseif ($setting->type == 'color') {{-- Date Picker --}} @elseif ($setting->type == 'date') {{-- Checkbox --}} @elseif ($setting->type == 'checkbox' || $setting->type == 'boolean') value ? 'checked' : '' }}> {{-- Radio Buttons --}} @elseif ($setting->type == 'radio') @foreach ($setting->value as $option)
value == $option ? 'checked' : '' }}>
@endforeach {{-- Dropdown (select) --}} @elseif(is_array($setting->options) || is_object($setting->options)) @foreach ($setting->options as $option)
@endforeach @endif {{-- Multi-select (JSON or array-based) --}} @elseif ($setting->type == 'json')
@php $values = json_decode($setting->value, true) ?: []; @endphp @foreach ($values as $val) @endforeach
@endif {{-- Description --}} @if ($setting->description) {{ $setting->description }} @endif
@endforeach
{{-- JavaScript for adding dynamic input fields --}} @endsection