@foreach ($products as $product) @endforeach @foreach ($groups as $group) @foreach ($products as $product) @endforeach @php $specifications = \DB::table('product_specification') ->where('specification_group_id', $group->id) ->whereIn('product_id', $products->pluck('id')) ->orderBy('group_ordering') ->get(); @endphp @foreach ($specifications->unique('specification_id') as $specification) @php $spec = \DB::table('specifications')->find($specification->specification_id); @endphp @foreach ($products as $product) @php $specification_value = $specifications ->where('specification_id', $spec->id) ->where('product_id', $product->id) ->first(); @endphp @endforeach @endforeach @endforeach @foreach ($products as $product) @endforeach
@if ($products->count() < 3)
@endif
{{ $group->name }} {{ $product->title }}
{{ $spec->name }}{{ $specification_value ? $specification_value->value : '-' }}
{{ trans('front::messages.products.compare-show-product') }}