@php $isEdit = isset($listing) && $listing; $formAction = $isEdit ? route('dealers.listings.update', $listing->id) : route('dealers.listings.store'); $method = $isEdit ? 'PUT' : 'POST'; // Get existing values for edit mode $spec = $isEdit ? $listing->specification : null; $existingFeatures = $isEdit ? $listing->features->pluck('id')->toArray() : []; $existingImages = $isEdit ? $listing->image_url ?? [] : []; $existingFinancing = $isEdit ? $listing->financing_options ?? [] : []; // Get features $safetyFeatures = \App\Models\VehicleFeature::where('category', 'safety')->get(); $comfortFeatures = \App\Models\VehicleFeature::where('category', 'comfort')->get(); $entertainmentFeatures = \App\Models\VehicleFeature::where('category', 'entertainment')->get(); @endphp
@csrf @if ($isEdit) @method('PUT') @endif {{-- 1. Basic Information --}}
1. Basic Information
@if ($isEdit) VIN cannot be changed after creation. @endif
{{-- 2. Technical Specifications --}}
2. Technical Specifications
{{-- 3. Body and Exterior --}}
3. Body and Exterior
{{-- 4. Price and Financing --}}
4. Price and Financing
{{-- 5. Features and Options --}}
5. Features and Options

Select all features that apply to this vehicle

Safety Features
@foreach ($safetyFeatures as $feature)
id, old('features', $existingFeatures)) ? 'checked' : '' }}>
@endforeach
Comfort Features
@foreach ($comfortFeatures as $feature)
id, old('features', $existingFeatures)) ? 'checked' : '' }}>
@endforeach
Entertainment Features
@foreach ($entertainmentFeatures as $feature)
id, old('features', $existingFeatures)) ? 'checked' : '' }}>
@endforeach
{{-- 6. Additional Information --}}
6. Additional Information
{{-- 7. Vehicle Images --}}
7. Vehicle Images *

Upload clear photos of your vehicle (minimum 3 images required)

{{-- Submit Button --}}
Cancel