@extends('admin.layouts.app') @section('title', 'Product Details') @section('page_title', 'Product Details') @section('content') @php $images = is_array($product->images) ? $product->images : json_decode($product->images ?? '[]', true); $images = is_array($images) ? $images : []; $firstImage = $images[0] ?? null; @endphp

{{ $product->title }}

Created by {{ optional($product->user)->name ?: 'Deleted user' }}

@csrf @method('PATCH')
@csrf @method('PATCH')
@csrf @method('DELETE')
@if($firstImage) {{ $product->title }} @else
No image
@endif @if(count($images) > 1)
@foreach($images as $image) @endforeach
@endif
Seller {{ optional($product->user)->name ?: 'Deleted user' }}
Seller email {{ optional($product->user)->email ?: '-' }}
Category {{ $product->category }}
Brand {{ $product->brand ?: '-' }}
Size {{ $product->size ?: '-' }}
Condition {{ $product->condition ?: '-' }}
Price ${{ number_format($product->price, 2) }}
Discount price {{ $product->discount_price ? '$' . number_format($product->discount_price, 2) : '-' }}
Approval {{ $product->is_approved ? 'Approved' : 'Pending' }}
Status {{ ucfirst($product->status ?: 'available') }}
Location {{ $product->location ?: '-' }}
Created {{ optional($product->created_at)->format('M d, Y H:i') }}
Description

{{ $product->description ?: 'No description.' }}

@endsection