@extends('backend.layouts.app') @section('title', 'Edit Photo') @section('content') @php $pageTitle = 'Edit Photo'; $indexRoute = 'content-photo-list.index'; $indexLabel = 'Photos'; $parentRoute = 'content-photo-gallery.index'; $parentLabel = 'Photo Galleries'; @endphp @include('backend.layouts.partials._page_header') @php $inputBaseClass = 'dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:ring-brand-500/10 dark:focus:border-brand-800 h-11 w-full rounded-lg border bg-transparent px-4 py-2.5 text-sm text-gray-800 placeholder:text-gray-400 focus:ring-3 focus:outline-hidden dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30'; $inputClass = $inputBaseClass . ' border-gray-300 dark:border-gray-700'; @endphp
@csrf @method('PUT')

Photo Information

@error('photo_gallery_id')

{{ $message }}

@enderror
@error('photo_sort')

{{ $message }}

@enderror
Current Image @if($photo->photo_url)

Current: {{ basename($photo->photo_url) }}

@endif
@include('backend.layouts.partials._upload-hint', ['text' => 'Photo · 1920 × 1080 px recommended · JPG, PNG, WebP · Max 15MB']) @error('photo_url')

{{ $message }}

@enderror
{{-- Translations --}} @if ($photo->photo_main === '1' || $photo->photo_main === 1)

Translations

@php $firstLang = array_key_first($languages->toArray()); $mainLangCode = old('photo_language', $photo->photo_language) ?: $firstLang; @endphp
@foreach ($languages as $code => $descr) @php $translation = $translations->firstWhere('photo_language', $code); $isMain = $code === $mainLangCode; @endphp
@endforeach
@foreach ($languages as $code => $descr) @php $translation = $translations->firstWhere('photo_language', $code); $isMain = $code === $mainLangCode; $descrVal = old("translations.$code.descr", $isMain ? $photo->photo_descr : ($translation->photo_descr ?? '')); @endphp
@error('translations.' . $code . '.descr')

{{ $message }}

@enderror
@endforeach
@endif
Cancel
@endsection @push('scripts') @endpush