@php use Illuminate\Support\Carbon;use Illuminate\Support\Collection; @endphp @extends('admin::layouts.master') @section('title','Product Edit') @section('content')
@csrf @if(isset($product['id'])) @method('put') @endif
@if(config('openai.openai.enabled')) @endif

@lang('attributes')

@php $attributeValuesMap = []; if (isset($product) && is_object($product) && isset($product->attributeValues)) { foreach ($product->attributeValues as $av) { $attributeValuesMap[$av->attribute->code] = $av->text_value ?? $av->string_value ?? $av->integer_value ?? $av->float_value ?? $av->decimal_value ?? $av->boolean_value ?? $av->date_value ?? $av->url_value ?? $av->hex_value ?? null; } } @endphp @foreach($attributes as $attribute) @php $value = old('attributes.' . $attribute->code, $attributeValuesMap[$attribute->code] ?? ''); $isCustom = ($value && (!isset($attribute->options) || !collect($attribute->options)->pluck('value')->contains($value))); @endphp
@if (!empty($attribute->options) && count($attribute->options)) @else @endif
@endforeach
@if(isset($product) && is_object($product) && $product->hasMedia('images'))
Product Image
@endif

Yes
@if(isset($product) && is_object($product))
@foreach($product->getMedia('product') as $media)
Image
@csrf @method('DELETE')
@endforeach
@endif @push('styles') @endpush @push('scripts') @endpush @endsection