@php $edit = !is_null($dataTypeContent->getKey()); $add = is_null($dataTypeContent->getKey()); @endphp @extends('voyager::master') @section('css') @stop @section('page_title', __('voyager::generic.'.($edit ? 'edit' : 'add')).' '.$dataType->getTranslatedAttribute('display_name_singular')) @section('page_header')

{{ __('voyager::generic.'.($edit ? 'edit' : 'add')).' '.$dataType->getTranslatedAttribute('display_name_singular') }}

@include('voyager::multilingual.language-selector') @stop @section('content')
@if($edit) {{ method_field("PUT") }} @endif {{ csrf_field() }}
@if (count($errors) > 0)
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @php $dataTypeRows = $dataType->{($edit ? 'editRows' : 'addRows' )}; @endphp @foreach($dataTypeRows as $row) @php $display_options = $row->details->display ?? NULL; if ($dataTypeContent->{$row->field.'_'.($edit ? 'edit' : 'add')}) { $dataTypeContent->{$row->field} = $dataTypeContent->{$row->field.'_'.($edit ? 'edit' : 'add')}; } @endphp @if (isset($row->details->legend) && isset($row->details->legend->text)) {{ $row->details->legend->text }} @endif @endforeach {{-- ==== CUSTOM: Image Upload (Photo ID) ==== --}}

Note: This option won't be shown on some devices.

{{-- Existing images (Photo ID) --}}
@php use Illuminate\Support\Str; $imageExtensions = ['jpg','jpeg','png','webp','gif','bmp']; @endphp @isset($uploadPhoto) @forelse($uploadPhoto as $dataAdditional) @php $path = $dataAdditional->file_name ?? ''; $fileUrl = $path ? asset($path) : ''; $ext = Str::of($path)->lower()->afterLast('.'); $isImage = $ext && in_array($ext, $imageExtensions, true); @endphp @if($fileUrl) @if($isImage) @else @endif @endif @empty No Image @endforelse @else No Image @endisset

{{-- ==== CUSTOM: Image Upload (Item Bought) ==== --}}

Note: This option won't be shown on some devices.

{{-- Existing images (reuse same $uploadPhoto set if that’s what you have for this section; swap if you have a different collection) --}}
@isset($uploadPhoto) @forelse($uploadPhoto as $dataAdditional) @php $path = $dataAdditional->file_name ?? ''; $fileUrl = $path ? asset($path) : ''; $ext = Str::of($path)->lower()->afterLast('.'); $isImage = $ext && in_array($ext, $imageExtensions, true); @endphp @if($fileUrl) @if($isImage) @else @endif @endif @empty No Image @endforelse @else No Image @endisset

@stop @section('javascript') @stop