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

Vehicle Makes

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

No vehicle makes found

Add vehicle makes in Vehicle Manager first, then return here to add engine filters.

@else
@foreach ($makes as $make) @endforeach
Make Engines Parts Actions
@if ($make->image && file_exists(public_path("img/makes/{$make->image}"))) {{ $make->make }} @else
{{ strtoupper(substr($make->make, 0, 1)) }}
@endif
{{ $make->make }}
@if (!$make->active) Hidden from site @endif
{{ $make->engine_count }} {{ $make->parts_count }}
@endif
{{-- Info sidebar --}}

About Engine Filters

What are engine filters?

Engine filters let you link products to specific engine types (e.g. "2.0L Turbo", "V8 5.0") independent of a vehicle year. Customers browsing by engine will see these matched parts.

Managing makes

Makes are shared with the Vehicle Manager. To add, edit or remove a make, go to Vehicle Manager → Makes.

Bulk import via CSV

Select a make and use the CSV import on the engine step to bulk-load engines and parts.

Format: make, engine, part_number

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

{{ $selectedMake?->make }} — Engine Filters

{{ $engines->count() }} {{ Str::plural('engine', $engines->count()) }} • {{ $engines->sum('products_count') }} parts total • Link parts to specific engine types.

{{ $engines->count() }} {{ Str::plural('engine', $engines->count()) }}
{{-- Engines + parts (main area) --}}
@if ($engines->isEmpty())

No engine filters yet

Add the first engine type using the form on the right (e.g. "2.0L Turbo", "V8 5.0L").

@else @foreach ($engines as $engine) @php $products = $this->getProducts($engine->id_engine_filter); @endphp
{{-- Engine card header --}}
@if ($engine->image && file_exists(public_path("img/engines/{$engine->image}"))) {{ $engine->engine }} @else
@endif
{{ $engine->engine }}
{{ $products->count() }} {{ Str::plural('part', $products->count()) }} @if (!$engine->active) inactive @endif
{{-- Action buttons --}}
{{-- Parts list --}} @if ($products->isNotEmpty())
@foreach ($products as $product)
{{ $product->part_number }}
@endforeach
@else
No parts linked yet — use the form below to add one.
@endif {{-- Add part form (with autocomplete) --}}
@if (!empty($partSearchResults[$engine->id_engine_filter]))
@foreach ($partSearchResults[$engine->id_engine_filter] as $result) @endforeach
@endif
@endforeach @endif
{{-- Right column: Add Engine + CSV import --}}
{{-- Add Engine --}}

Add Engine Filter

e.g. 2.0L Turbo, V8 5.0L, 1.6L NA

JPG/PNG/WebP. Shown as a small thumbnail on the engine card.

Tip: part autocomplete

When adding parts, type at least 2 characters of a part number to see matching products. Clicking a result populates the field and opens the product page in a new tab.

{{-- CSV Import --}}

Bulk CSV Import

Import engines and parts in one go

Expected columns:
make, engine, part_number
BMW, 2.0L Turbo, DWK-100|DWK-200

Use | to separate multiple part numbers per row. Makes are auto-created if missing.

@if ($csvResult)
{{ $csvResult }}
@endif
@endif
{{-- ══════════════════════════════════════════════════════════════════════════════ --}} {{-- EDIT ENGINE MODAL --}} {{-- ══════════════════════════════════════════════════════════════════════════════ --}} @if ($editEngineOpen)

Edit Engine Filter

@endif