@extends('admin.master_layout') @section('title') {{ $pageTitle }} @endsection @section('body-header')

{{ $pageTitle }}

{{ __('translate.Frontend Management') }} >> {{ $pageTitle }}

@endsection @section('body-content')

{{ __('translate.Switch to language translation') }}

@php function renderFormFields($content, $dataValues, $parentKey = '') { // Fields to skip $skipFields = ['builder', 'name', 'images', 'type']; foreach ($content as $field => $value) { if (in_array($field, $skipFields)) continue; // Handle nested structures if (is_array($value) && !isset($value['type'])) { echo '
'; echo '
'; echo '
' . str_replace('_', ' ', ucfirst($field)) . '
'; echo '
'; echo '
'; $newParentKey = $parentKey ? "{$parentKey}[{$field}]" : $field; renderFormFields($value, $dataValues[$field] ?? [], $newParentKey); echo '
'; echo '
'; } else { // Handle input fields for leaf nodes $fieldName = $parentKey ? "{$parentKey}[{$field}]" : $field; $fieldValue = $dataValues[$field] ?? ''; echo '
'; echo ''; echo ''; echo '
'; } } } @endphp
@csrf @method('PUT')
@if($lang_code === 'en' && isset($content['images']) && count($content['images']) > 0)
@foreach($content['images'] as $imageKey => $imageDetails) @php $existingImagePath = $dataValues['images'][$imageKey] ?? null; @endphp
@endforeach
@endif {{-- Content Section --}}
@if($content) @php $renderContent = isset($content['content']) ? $content['content'] : $content; renderFormFields($renderContent, $dataValues ?? []); @endphp @else

{{ __('translate.Nothing to display') }}

@endif
@endsection @push('style_section') @endpush @push('js_section') @endpush