@include('admin.partials.header') @include('admin.partials.sidebar') @include('admin.partials.topbar') @include('admin.partials.management-styles') @php $typeMeta = [ 'job' => ['label' => 'Job Listing', 'icon' => 'work'], 'rent' => ['label' => 'Rental Listing', 'icon' => 'apartment'], 'hostel' => ['label' => 'Hostel Listing', 'icon' => 'bed'], 'service' => ['label' => 'Service Listing', 'icon' => 'construction'], ]; $meta = $typeMeta[$type] ?? ['label' => 'Listing', 'icon' => 'inventory_2']; $skills = old('skills_required', is_array($listing->skills_required ?? null) ? implode(', ', $listing->skills_required) : ($listing->skills_required ?? '')); $workingDays = old('working_days', $listing->working_days ?? []); $allMediaItems = ($listing->media ?? collect())->map(function ($media) { $media->image_url = $media->file_path ? asset('storage/'.$media->file_path) : null; return $media; })->filter(fn ($media) => $media->image_url); $mediaItems = $allMediaItems->filter(fn ($media) => ($media->file_type ?? null) === 'image'); $documentItems = $allMediaItems->filter(fn ($media) => ($media->file_type ?? null) === 'document'); $profileMedia = $mediaItems->first(fn ($media) => ($media->media_label ?? null) === 'profile_photo'); $pastWorkMedia = $mediaItems->filter(fn ($media) => in_array(($media->media_label ?? null), ['primary', 'gallery'], true)); $toolsMedia = $mediaItems->filter(fn ($media) => str_starts_with((string) ($media->media_label ?? ''), 'tools_')); $otherMediaItems = $mediaItems ->reject(fn ($media) => ($media->media_label ?? null) === 'profile_photo') ->reject(fn ($media) => str_starts_with((string) ($media->media_label ?? ''), 'tools_')) ->reject(fn ($media) => in_array(($media->media_label ?? null), ['primary', 'gallery'], true)); @endphp
Adminchevron_right Listings chevron_rightEdit

Edit {{ $meta['label'] }}

Update approved listing details and keep marketplace content current.

arrow_back Back to listings
@if ($errors->any())
Please review the form.
@endif
{{ $meta['icon'] }}

{{ $meta['label'] }}

LST-{{ strtoupper($type) }}-{{ str_pad((string) $listing->id, 5, '0', STR_PAD_LEFT) }} · {{ ucfirst((string) $listing->status) }}

@csrf @method('PUT')
@if ($type === 'service')

Profile Photo

@if ($profileMedia?->image_url)
Profile Profile photo
Profile Photo - {{ basename((string) $profileMedia->file_path) }}
@else
No profile photo uploaded.
@endif

Past Work Images

@if ($pastWorkMedia->isNotEmpty())
@foreach ($pastWorkMedia as $media)
@if (($media->media_label ?? null) === 'primary') Primary @endif Past work image
Past Work - {{ basename((string) $media->file_path) }}
@endforeach
@else
No past work images uploaded.
@endif

Tools and Equipment Images

@if ($toolsMedia->isNotEmpty())
@foreach ($toolsMedia as $media)
Tools and equipment image
Tools and Equipment - {{ basename((string) $media->file_path) }}
@endforeach
@else
No tools and equipment images uploaded.
@endif @if ($otherMediaItems->isNotEmpty())

Other Images

@foreach ($otherMediaItems as $media)
Listing image
{{ $media->media_label ?: 'Image' }} - {{ basename((string) $media->file_path) }}
@endforeach
@endif @endif @if ($type !== 'service')

Listing Images

@if ($mediaItems->isNotEmpty())
@foreach ($mediaItems as $media)
@if (($media->media_label ?? null) === 'primary') Primary @endif {{ $media->media_label ?: 'Listing image' }}
{{ $media->media_label ?: 'Gallery' }} · {{ basename((string) $media->file_path) }}
@endforeach
@else
No images uploaded for this listing.
@endif @endif @if ($documentItems->isNotEmpty())

{{ $type === 'service' ? 'Submitted Documents' : 'Listing Documents' }}

@endif
@if ($type === 'job')
@elseif ($type === 'rent')
@elseif ($type === 'hostel')
@foreach (['wifi_available' => 'WiFi', 'food_mess' => 'Food / mess', 'power_backup' => 'Power backup', 'security_guard' => 'Security'] as $field => $label) @endforeach
@elseif ($type === 'service')
@foreach (['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] as $day) @endforeach
@endif
@include('admin.partials.footer')