@php $makes = $this->getMakes(); $selectedMake = $this->getSelectedMake(); $selectedModel= $this->getSelectedModel(); @endphp
{{-- ── Step indicator ────────────────────────────────────────────────────── --}}
{{-- Step 1 --}}
{{-- Step 2 --}}
{{-- Step 3 --}}
{{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- LEVEL 1: MAKES --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @if ($level === 'makes')
{{-- Makes table --}}

Vehicle Makes

{{ $makes->count() }}
@if ($makes->isEmpty())

No vehicle makes yet

Add your first make using the form on the right, or import via CSV.

@else
@foreach ($makes as $make) @endforeach
Make Models Years Parts Actions
{{ $make->make }}
@if (!$make->active) Hidden from site @endif
{{ $make->models_count }} {{ $make->years_count }} {{ $make->products_count }}
@endif
{{-- Add make form --}}

Add New Make

e.g. BMW, Ford, Toyota

JPG/PNG/WebP, max 3MB. Shown as a circular logo.

{{-- CSV hint --}}

Bulk import via CSV

Use the CSV import on the Years & Parts step to bulk-load makes, models, years and part numbers in one go.

Format: make, model, year, part_number, stage

{{-- Edit Make modal --}} @if ($editMakeOpen)

Edit Make

@endif {{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- LEVEL 2: MODELS --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @elseif ($level === 'models') @php $models = $this->getModels(); @endphp
{{-- Models table --}}
{{-- Make header --}}
@if ($selectedMake?->image && file_exists(public_path("img/makes/{$selectedMake->image}"))) @else
{{ strtoupper(substr($selectedMake?->make ?? '?', 0, 1)) }}
@endif

{{ $selectedMake?->make }} — Models

{{ $models->count() }} {{ Str::plural('model', $models->count()) }} · Click a model to manage its years and parts

@if ($models->isEmpty())

No models yet for {{ $selectedMake?->make }}

Add a model using the form on the right (e.g. "135i", "Mustang GT").

@else
@foreach ($models as $model) @endforeach
Model Years Parts Actions
{{ $model->name }}
@if (!$model->active) Hidden from site @endif
{{ $model->years_count }} {{ $model->products_count }}
@endif
{{-- Add model form --}}

Add Model to {{ $selectedMake?->make }}

e.g. 135i, Mustang GT, Corolla

Photo of the vehicle model. Shown on the models list.

What is a model?

A model is a specific vehicle name under a make. After adding a model you'll be able to add the years it was manufactured and link compatible parts.

{{-- Edit Model modal --}} @if ($editModelOpen)

Edit Model

@endif {{-- ══════════════════════════════════════════════════════════════════════════ --}} {{-- LEVEL 3: YEARS & PARTS --}} {{-- ══════════════════════════════════════════════════════════════════════════ --}} @elseif ($level === 'years') @php $years = $this->getYears(); @endphp
{{-- Context header --}}

{{ $selectedMake?->make }} {{ $selectedModel?->name }} — Years & Parts

Each year entry represents a production year for this model. You link compatible parts to each year.

{{ $years->count() }} {{ Str::plural('year', $years->count()) }}
{{-- Years + parts (main area) --}}
@if ($years->isEmpty())

No years added yet

Add a production year using the form on the right, e.g. "2018" or "2015-2020".

@else @foreach ($years as $yr) @php $products = $this->getProducts($yr->id_vehicle_filter); @endphp
{{-- Year card header --}}
{{ $yr->year }} {{ $products->count() }} {{ Str::plural('part', $products->count()) }} @if (!$yr->active) Hidden @endif
{{-- Parts list --}} @if ($products->isNotEmpty())
@foreach ($products as $product)
{{ $product->part_number }} @php $stageLabels = ['Stock', 'Stage 1', 'Stage 2', 'Stage 3', 'Stage 4']; $stageColors = ['bg-gray-100 text-gray-600', 'bg-blue-50 text-blue-700', 'bg-purple-50 text-purple-700', 'bg-orange-50 text-orange-700', 'bg-red-50 text-red-700']; $s = (int) $product->stage; @endphp {{ $stageLabels[$s] ?? 'Stock' }}
@endforeach
@else
No parts linked yet — use the form below to add one.
@endif {{-- Add part form (with autocomplete) --}}
@if (!empty($partSearchResults[$yr->id_vehicle_filter]))
@foreach ($partSearchResults[$yr->id_vehicle_filter] as $result) @endforeach
@endif
@endforeach @endif
{{-- Right column: Add year + CSV import --}}
{{-- Add Year --}}

Add Year

Supports single years or ranges

Use a range like "2015-2020" if multiple years share the same compatible parts.

{{-- CSV Import --}}

Bulk CSV Import

Import makes, models, years and parts at once

Expected columns:
make, model, year, part_number, stage
BMW, 135i, 2010-2012, DWK-100|DWK-200, 1

Use | to separate multiple part numbers per row.

@if ($csvResult)
{{ $csvResult }}
@endif
@endif