@extends('admin::layouts.master') @section('title', 'Product Details') @section('content')

Product Details

Edit Back
@php $product->load('media'); @endphp @if($product->image_url)
{{ $product->name }}
@endif
@foreach(['id', 'name', 'slug', 'price', 'unit', 'unit_price', 'brand', 'discount', 'original_price', 'stock_quantity', 'nutri_score', 'ingredients', 'allergens_info', 'is_active', 'is_save_the_food', 'is_weekly_special'] as $field) @endforeach
{{ ucwords(str_replace('_', ' ', $field)) }} @if(in_array($field, ['price', 'unit_price', 'original_price', 'discount']) && $product->$field) €{{ number_format($product->$field, 2) }} @elseif(in_array($field, ['is_active', 'is_save_the_food', 'is_weekly_special'])) {{ $product->$field ? 'Yes' : 'No' }} @elseif($field === 'description') {{ $product->description ?? '-' }} @else {{ $product->$field ?? '-' }} @endif
Category {{ $product->category?->name ?? '-' }}
Created {{ $product->created_at->format('Y-m-d H:i') }}
@if($product->media->isNotEmpty())

Media ({{ $product->media->count() }})

+ Add Media
@foreach($product->media as $media)
@if($media->type === 'image') {{ $media->filename }} @else
{{ $media->type }}
@endif
{{ $media->filename }}
@endforeach
@else

No media attached.

Upload media
@endif @endsection