@php
$supported = ['category', 'brand', 'min_price', 'max_price'];
$filters = collect(request()->only($supported))->filter(fn ($value) => $value !== null && $value !== '');
$hasPrice = $filters->has('min_price') || $filters->has('max_price');
$priceLabel = $hasPrice
? ($filters->get('min_price') ?? '…') . ' – ' . ($filters->get('max_price') ?? '…') . ' €'
: null;
$filters = $filters->except(['min_price', 'max_price']);
$labels = [
'category' => __('shop.category'),
'brand' => __('shop.brand'),
];
@endphp
@if($filters->isNotEmpty() || $hasPrice)
@foreach($filters as $key => $value)
{{ $labels[$key] ?? ucfirst($key) }}: {{ $key === 'category' && isset($selectedCategory) ? $selectedCategory->name : $value }}
×
@endforeach
@if($hasPrice)
{{ __('shop.price') }}: {{ $priceLabel }}
×
@endif
{{ __('shop.clear_all') }}
@endif