Our complete database.
Board Name | @foreach($attributes as $attribute){{ $attribute->name }} | @endforeach|
---|---|---|
{{ $product->name }} | @foreach($attributes as $attribute)@php $value = null; $value = $product->values->where('attribute_id', $attribute->id)->first(); @endphp @if($attribute->type_id == '1' || $attribute->type_id == '2' || $attribute->type_id == '5') @if(!empty($value)) {{ $attribute->unit_before }}{{ $value->value }}{{ $attribute->unit_after }} @endif @elseif($attribute->type_id == '3') @php $single_select_option = null; if(isset($value)) { $single_select_option = $options->where('id', $value->value)->first(); } @endphp @if(isset($single_select_option)){{ $attribute->unit_before }}{{ $single_select_option->name }}{{ $attribute->unit_after }}@endif @elseif($attribute->type_id == '4') @php $multiple_select_options = null; if(isset($value)) { $multiple_select_options = explode(',', $value->value); } @endphp @foreach($multiple_select_options as $option) @php $value = $options->where('id', $option)->first(); @endphp {{ $value->name }}@if($loop->remaining > 0),@endif @endforeach @elseif($attribute->type_id == '6') @elseif($attribute->type_id == '7') @endif | @endforeachShow More! |