@extends('contentNavbarLayout') @section('title', 'Edit ' . $recordType->name) @section('content')
{{-- Page Header --}}

Records / Edit {{ $recordType->name }}

Back to List
{{-- Success Message --}} @if(session('success')) @endif {{-- Global Error List --}} @if ($errors->any()) @endif {{-- Record Edit Form --}}
@csrf @method('PUT') {{-- Default Fields --}}
@error('title')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
{{-- Main File Upload --}}
@if(!empty($record->file_path))
Current file: {{ basename($record->file_path) }}
@endif Leave empty to keep current file. Upload new file to replace. @error('file_path')
{{ $message }}
@enderror

{{-- Dynamic Properties --}} @if($recordType->properties->count() > 0)
Additional Information
@foreach($recordType->properties as $property) @php $columnName = strtolower(str_replace(' ', '_', $property->name)); $columnName = preg_replace('/[^a-z0-9_]/', '', $columnName); $currentValue = $record->$columnName ?? ''; $isRequired = $property->pivot && $property->pivot->is_required; @endphp
@if($property->data_type === 'text') @elseif($property->data_type === 'number') @elseif($property->data_type === 'date') @elseif($property->data_type === 'textarea') @elseif($property->data_type === 'email') @elseif($property->data_type === 'file') @php $fileColumnPath = $columnName . '_path'; $currentFilePath = $record->$fileColumnPath ?? ''; @endphp @if(!empty($currentFilePath))
Current file: {{ basename($currentFilePath) }}
@endif @if(!empty($currentFilePath)) Leave empty to keep current file. @elseif($isRequired) This field is required. @endif @elseif($property->data_type === 'dropdown') @else @endif @error($columnName)
{{ $message }}
@enderror @if($property->description) {{ $property->description }} @endif
@endforeach @endif {{-- Form Actions --}}
Cancel
@endsection