@extends('frontend.layouts.app') @section('title') {{ $title ?? 'Page header' }} @endsection @section('meta') @endsection @push('style') @endpush @section('content') @include('frontend.layouts.includes.breadcrumb', [ 'links' => [[$title => route('user.ads.update', ['id' => $ads?->id])], [$ads?->title => '']], ])

Fill in the details

@csrf
@error('title') {{ $message }} @enderror
{{--
--}}
{!! $errors->first('address', '') !!}
{{-- {{ dd($ads?->belongsToCategory) }} --}} @if (!in_array($ads?->belongsToCategory->slug, ['jobs', 'seeking-work-cvs']))
{{ $setting->currency_symbol }} {{-- @error('price') {{ $message }} @enderror --}}
negotiable == '1' ? 'checked' : '' }} id="negotiable">
@endif @includeWhen( $ads?->belongsToCategory->slug == 'jobs', 'user.ads.partials.edit.job') @if (isset($fields) && count($fields) > 0 && $ads?->belongsToCategory->slug != 'jobs') @php // Sort fields by order if available $sortedFields = collect($fields)->sortBy('order')->values()->all(); // Map existing field values for easier lookup $existingValues = []; if ($ads->hasManyFields) { foreach ($ads->hasManyFields as $fv) { $existingValues[$fv->field_id] = $fv->value; } } @endphp @php $conditionTextareaShown = false; @endphp
@foreach ($sortedFields as $field) @php $fieldName = 'fields[' . $field['id'] . '][value]'; $fieldTypeName = 'fields[' . $field['id'] . '][type]'; // Fill value: old input > existing record > default field value $fieldValue = old( 'fields.' . $field['id'] . '.value', $existingValues[$field['id']] ?? ($field['value'] ?? ''), ); $isRequired = !empty($field['required']) ? 'required' : ''; $options = $field['options'] ?? []; $placeholder = $field['placeholder'] ?? 'Enter ' . $field['name']; @endphp
@switch($field['type']) @case('text') @case('number') @break @case('brand') @error('brand_id') {{ $message }} @enderror @break @case('brand_model') @break @case('textarea') @break @case('select') @break @case('radio')
@foreach ($options as $option) @php $optVal = $option['value'] ?? ($option['id'] ?? ''); $optLabel = $option['label'] ?? ($option['value'] ?? $optVal); $optionId = 'field_' . $field['id'] . '_' . $loop->index; @endphp
@endforeach
@if(!$conditionTextareaShown)
@php $conditionTextareaShown = true; @endphp @endif @break @break @case('checkbox') @php $selectedValues = []; if (!empty($fieldValue)) { if (is_string($fieldValue)) { $selectedValues = json_decode($fieldValue, true) ?: []; } elseif (is_array($fieldValue)) { $selectedValues = $fieldValue; } } @endphp
@foreach ($options as $option) @php $optVal = $option['value'] ?? ($option['id'] ?? ''); $optLabel = $option['label'] ?? ($option['value'] ?? $optVal); $optionId = 'field_' . $field['id'] . '_' . $loop->index; @endphp
@endforeach
@break @default @endswitch @error('fields.' . $field['id'] . '.value') {{ $message }} @enderror
@endforeach
@endif
@error('description') {{ $message }} @enderror

{{-- Thumbnail Image start --}}
{!! $errors->first('thumbnail', '') !!}
{{-- Thumbnail Image end --}} @if (!in_array($ads?->belongsToCategory->slug, ['seeking-work-cvs']))

Add up to 5 photos ( Preferred image size 830x520px ) 2MB

You must upload at least one photo

@endif

Contact details

+233

@php $promotionActive = $ads?->featured && $ads?->promotion_ends_at && \Carbon\Carbon::now()->lt($ads->promotion_ends_at); @endphp

@if ($promotionActive)
Promotion is currently running and
will expire on {{ \Carbon\Carbon::parse($ads->promotion_ends_at)->format('d M Y') }}
@elseif ($ads?->promotion_ends_at)
Your promotion has expired.
Please choose another promotion package to promote your ad.
@endif
{{--

Mark as Featured {{$setting?->currency_symbol}} 17.00

--}}
@endsection @push('scripts') {{-- --}} @endpush