{{-- resources/views/admin/media/edit.blade.php --}} @extends('admin.layouts.app') @section('title', admin_trans('edit_file')) @section('page-title', admin_trans('edit_file')) @section('content')
{{ admin_trans('back_to_library') }}

{{ admin_trans('edit_file') }}

{{ admin_trans('download') }} {{ admin_trans('delete') }}
@if(str_starts_with($media->mime_type, 'image/')) @php // محاولة الحصول على الرابط بطرق مختلفة $url = null; $customProperties = $media->custom_properties ?? []; if (isset($customProperties['path'])) { $url = asset('storage/' . $customProperties['path']); } else { // محاولة استخدام getUrl إذا كان متاح try { $url = $media->getUrl(); } catch (\Exception $e) { // إذا فشل، جرب البحث في المجلد الافتراضي $possiblePaths = [ "media/{$media->id}/{$media->file_name}", "media/{$media->file_name}", $media->file_name ]; foreach ($possiblePaths as $path) { if (Storage::disk('public')->exists($path)) { $url = asset('storage/' . $path); break; } } } } @endphp @if($url) {{ $media->name }} @else

{{ admin_trans('image_not_available') }}

{{ $media->file_name }}

@endif @elseif(str_starts_with($media->mime_type, 'video/'))

{{ admin_trans('video_file') }}

{{ $media->file_name }}

@else

{{ admin_trans('document') }}

{{ $media->file_name }}

@endif
{{ admin_trans('filename') }}: {{ $media->file_name }}
{{ admin_trans('size') }}: {{ number_format($media->size / 1024, 1) }} KB
{{ admin_trans('element_type') }}: {{ $media->mime_type }}
{{ admin_trans('upload_date') }}: {{ $media->created_at->format('d/m/Y H:i') }}
@csrf @method('PUT')
@error('name')

{{ $message }}

@enderror
@error('collection_name')

{{ $message }}

@enderror
@error('model_type')

{{ $message }}

@enderror
@error('model_id')

{{ $message }}

@enderror
{{ admin_trans('save_changes') }} {{ admin_trans('cancel') }}
@push('scripts') @endpush @endsection