@php $isEdit = filled($record); $namePrefix = $isEdit ? 'edit_'.$record->id.'_' : 'create_'; $selectedImageId = (string) old('image_id', $record?->image_id); $mediaAssets = $selectOptions['mediaAssetRecords'] ?? collect(); $mediaImageUrl = static function ($asset) { if (! $asset?->file_path) { return null; } $path = $asset->file_path; if (str($path)->startsWith(['http://', 'https://', '/'])) { return $path; } if (str($path)->startsWith('storage/')) { return asset($path); } if (str($path)->startsWith('images/')) { return asset($path); } if (($asset->disk ?: 'public') === 'public') { return asset('storage/'.$path); } return \Illuminate\Support\Facades\Storage::disk($asset->disk)->url($path); }; @endphp
@csrf @if ($method !== 'POST') @method($method) @endif
01

English Fields

Primary public catalogue content.

@error('title_en')
{{ $message }}
@enderror
@error('material_en')
{{ $message }}
@enderror
@error('description_en')
{{ $message }}
@enderror
02

Assamese Fields

Localized catalogue content.

@error('title_as')
{{ $message }}
@enderror
@error('material_as')
{{ $message }}
@enderror
@error('description_as')
{{ $message }}
@enderror
03

General Details

Classification, image, status, and ordering.

@error('category_id')
{{ $message }}
@enderror
@error('period')
{{ $message }}
@enderror
Leave blank to auto-generate.
@error('slug')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror
@error('sort_order')
{{ $message }}
@enderror
{{-- This picker shows only recent images; the full media library opens in the Browse modal. --}}
No image selected

Choose an image from the media library below.

@forelse ($mediaAssets as $asset) @php $imageUrl = $mediaImageUrl($asset); $label = $asset->title_en ?: basename($asset->file_path); $searchText = str($label.' '.$asset->title_as.' '.$asset->file_path)->lower(); $isSelected = $selectedImageId === (string) $asset->id; @endphp @empty
No active image media found.
@endforelse
@error('image_id')
{{ $message }}
@enderror
is_featured))>
Cancel
@once {{-- One shared modal is used by every artefact form, so repeated edit modals stay lightweight. --}} @endonce