input('ids', []), 'is_numeric'); $ids = array_map('intval', $ids); if (empty($ids)) { return response()->json(['html' => '', 'count' => 0]); } $cars = Car::whereIn('id', $ids) ->where('status', 'active') ->orderByRaw('FIELD(id, '.implode(',', $ids).')') ->get(); $fuelLabels = ['petrol' => 'Бензин', 'diesel' => 'Дизель', 'hybrid' => 'Гибрид', 'electric' => 'Электро', 'gas' => 'Газ', 'other' => 'Другое']; $countryFlags = ['Германия' => '🇩🇪', 'Япония' => '🇯🇵', 'Корея' => '🇰🇷', 'США' => '🇺🇸', 'Китай' => '🇨🇳', 'ОАЭ' => '🇦🇪', 'Грузия' => '🇬🇪', 'Великобритания' => '🇬🇧', 'Франция' => '🇫🇷', 'Италия' => '🇮🇹']; $html = ''; foreach ($cars as $car) { $html .= view('pages.partials._car_card', compact('car', 'fuelLabels', 'countryFlags'))->render(); } return response()->json(['html' => $html, 'count' => $cars->count()]); } }