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

@yield('title')

@endsection @section('content')
< {{ __('Back to Packages') }}
@method('PUT') @csrf
{{ __('Edit Package') }}
@foreach ($languages as $key => $lang)
@if ($lang->id == 1)
{{-- Row 1: IOS Product ID (Name already shown above) --}}
@else
@endif @if ($lang->id == 1) @php $packageDurationType = ($package->duration == 'unlimited') ? 'unlimited' : 'limited'; $packageDurationValue = ($package->duration == 'unlimited') ? '' : $package->duration; $adsItemLimitType = ($package->item_limit == 'unlimited') ? 'unlimited' : 'limited'; $adsItemLimitValue = ($package->item_limit == 'unlimited') ? '' : $package->item_limit; $adsListingDurationType = $package->listing_duration_type ?? 'standard'; $adsListingDurationDays = $package->listing_duration_days ?? null; $featuredItemLimitType = ($package->item_limit == 'unlimited') ? 'unlimited' : 'limited'; $featuredItemLimitValue = ($package->item_limit == 'unlimited') ? '' : $package->item_limit; $featuredAdsDurationType = $package->listing_duration_type ?? 'standard'; $featuredAdsDurationDays = $package->listing_duration_days ?? null; $keyPoints = []; if (!empty($package->key_points)) { $keyPoints = json_decode($package->key_points, true) ?? []; } @endphp {{-- Row 2: Price and Discount Percentage --}}
{{-- Row 3: Final Price --}}
{{-- Package Duration Type --}}
{{ __('Days') }}
{{-- Package Type Radio Buttons (Read-only) --}}
{{ __('Package type cannot be changed after creation.') }}
type == 'item_listing' ? 'checked' : '' }} disabled>
type == 'advertisement' ? 'checked' : '' }} disabled>
{{-- Ad Listing Package Section --}}
{{ __('Ad Listing Package Settings') }}
{{-- Item Limit --}}
{{ __('Number') }}
{{-- Listing Duration Type --}}
{{ __('Days') }}
{{-- Featured Ads Package Section --}} {{-- Key Points --}}
@if (!empty($keyPoints) && count($keyPoints) > 0) @foreach ($keyPoints as $index => $keyPoint)
@endforeach @else
@endif
{{-- Image --}}
{{ __('(Leave empty to keep current image)') }}
@else @php $translatedKeyPoints = []; if (!empty($package->translations)) { $translation = $package->translations->where('language_id', $lang->id)->first(); if ($translation && !empty($translation->key_points)) { $translatedKeyPoints = json_decode($translation->key_points, true) ?? []; } } @endphp {{-- Key Points for other languages --}}
@if (!empty($translatedKeyPoints) && count($translatedKeyPoints) > 0) @foreach ($translatedKeyPoints as $index => $keyPoint)
@endforeach @else
@endif
@endif
@endforeach
{{ __('Category Selection') }}
{{-- Global Package Option --}}
is_global == 1 ? 'checked' : '' }} {{ $package->type == 'advertisement' ? 'disabled' : '' }}> {{ __('If checked, this package will be available for all categories.') }}
@foreach ($categories as $category)
@if (!empty($category->subcategories)) @php $currentLang = Session::get('language'); $isRtl = false; if (!empty($currentLang)) { try { $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 ? '' : ''; @endphp {!! $arrowIcon !!} @endif
@if (!empty($category->subcategories)) @include('category.treeview', [ 'categories' => $category->subcategories, 'selected_categories' => $selected_categories, 'selected_all_categories' => $selected_all_categories, ]) @endif
@endforeach
@endsection @section('js') @endsection