@extends('layouts.main') @section('title') {{ __('Custom Fields') }} @endsection @section('page-title')

@yield('title')

@endsection @section('content')
< {{ __('Back to Custom Fields') }} @if (in_array($custom_field->type, ['radio', 'checkbox', 'dropdown'])) + {{ __('Add Options') }} @endif
@method('PUT') @csrf
{{ __('Edit Custom Field') }}
@foreach ($languages as $key => $lang)
id == 1) required @endif>
@if ($lang->id == 1) {{-- Type (Only in English) - Read Only --}}
{{ __('Field type cannot be changed after creation.') }}
{{ __('(use 256 x 256 size for better view)') }}
required ? 'checked' : '' }}>{{ __('Required') }}
status ? 'checked' : '' }}>{{ __('Active') }}
@endif
@if ($lang->id != 1) {{ __('Used for translatable field types.') }} @endif
@endforeach
{{ __('Category') }}
@foreach ($categories as $category)
@if (!empty($category->subcategories)) @php // Get current language from Session (not from foreach loop) $currentLang = Session::get('language'); // Check RTL: use accessor which returns boolean (rtl != 0) $isRtl = false; if (!empty($currentLang)) { try { // Try to get raw attribute first, fallback to accessor $rtlRaw = method_exists($currentLang, 'getRawOriginal') ? $currentLang->getRawOriginal('rtl') : null; if ($rtlRaw !== null) { $isRtl = ($rtlRaw == 1 || $rtlRaw === true); } else { $isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1); } } catch (\Exception $e) { $isRtl = ($currentLang->rtl == true || $currentLang->rtl === 1); } } $arrowIcon = $isRtl ? '' : ''; // fa-caret-left for RTL, fa-caret-right for LTR @endphp {!! $arrowIcon !!} @endif
{{-- ✅ Show children open if parent or child is selected --}}
@if (!empty($category->subcategories)) @include('category.treeview', [ 'categories' => $category->subcategories, 'selected_categories' => $selected_categories, 'selected_all_categories' => $selected_all_categories, ]) @endif
@endforeach
{{-- add modal --}} @if (in_array($custom_field->type, ['radio', 'checkbox', 'dropdown'])) {{-- edit modal --}}
@endsection @section('js') @endsection