@extends('layouts.admin-layout') @section('title') Edit Product @endsection @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Edit Product

@csrf
@error('product_name'){{ $message }}@enderror
@error('approximately'){{ $message }}@enderror
@error('product_image'){{ $message }}@enderror
Preview
@error('product_video'){{ $message }}@enderror
@php $videoUrl = $find_product->productVideo('product_video'); @endphp

No video uploaded

@if($videoUrl) @endif
show_video ? 'checked' : '' }}>
{{-- Image Alt --}}
@error('image_alt'){{ $message }}@enderror
{{-- ── Maze Buy ── --}}
Maze Buy
@forelse ($find_product->prices as $item) @if ($item->type == 'BUY')
@endif @empty
@endforelse
Maze Rent
@forelse ($find_product->prices as $buy) @if ($buy->type == 'RENT')
@endif @empty

No rent data found

@endforelse
status === 1 ? 'checked' : '' }}>
@forelse($histories as $index => $history)
{{ $history->product_name }}
{{ $history->created_at->format('d M Y, h:i A') }}  ·  {{ $history->savedBy->name ?? 'System' }}
@if($history->is_for_buy) BUY @endif @if($history->is_for_rent) RENT @endif {{ $history->status ? 'Active' : 'Inactive' }} @if($history->approximately) {{ $history->approximately }} @endif
{{-- Image Alt Tag --}} @if($history->image_alt)
Image Alt Tag: {{ $history->image_alt }}
@endif {{-- Prices table with description --}} @if(!empty($history->prices)) @foreach($history->prices as $hp) @endforeach
Type Price Days Description
{{ $hp['type'] }} {{ $hp['price'] }} {{ $hp['days'] ?: '—' }} @if(!empty($hp['description']))
{!! strip_tags($hp['description']) !!}
@else @endif
@endif
@empty
No history yet. History saves on every update.
@endforelse
@endsection @section('script') @endsection