{{-- Вьюха: Список автомобилей с фильтрами и пагинацией Создана: 2026-05-06 Контроллер: Admin\CarController::index() Переменные: $cars (LengthAwarePaginator), $makes, $platforms — для фильтров --}} @extends('admin.layout') @section('title', 'Автомобили') @section('content_header')

Автомобили

Добавить
@stop @section('breadcrumb') @stop @section('content') @if(session('success'))
{{ session('success') }}
@endif @php // Базовые параметры фильтра (без platform и page) — для построения URL кнопок площадок $baseParams = array_filter( request()->only(['q', 'status', 'condition', 'make']), fn($v) => $v !== null && $v !== '' ); $activePlatform = request('platform', ''); @endphp {{-- Быстрый фильтр по площадкам — кнопки из справочника --}} @if($platforms->isNotEmpty())
Площадка: Все @foreach($platforms as $platform) {{ $platform }} @endforeach @if($activePlatform !== '') сбросить @endif
@endif {{-- Фильтры (поиск + остальные поля) --}}

Фильтры

@if($activePlatform) @endif
{{-- Таблица --}}
@forelse($cars as $car) @empty @endforelse
ID Фото Марка / Модель Год Площадка Статус Состояние Цена (₽) Пробег Действия
{{ $car->id }} @if($car->photo_main) @else
@endif
{{ $car->make }} {{ $car->model }} @if($car->generation) {{ $car->generation }} @endif {{ $car->year }} @if($car->platform) {{ $car->platform }} @else @endif @php $badge = match($car->status) { 'active' => 'success', 'sold' => 'secondary', 'draft' => 'warning', default => 'light', }; @endphp {{ $car->status_label }} {{ $car->condition_label }} {{ $car->price_rub ? number_format($car->price_rub, 0, '.', ' ') : '—' }} {{ $car->mileage_km ? number_format($car->mileage_km, 0, '.', ' ') . ' км' : '—' }}
@csrf @method('DELETE')
Автомобили не найдены. Добавить первый
@if($cars->hasPages()) @endif
@stop @section('plugins.Select2', true)