- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
3.4 KiB
PHP
50 lines
3.4 KiB
PHP
<x-layouts.admin :title="__('admin.upload_file')">
|
|
<h1 class="text-2xl font-bold mb-6">{{ __('admin.upload_file') }}</h1>
|
|
|
|
<div class="bg-white rounded-lg shadow p-6 max-w-lg">
|
|
<form method="POST" action="{{ route('admin.files.store') }}" enctype="multipart/form-data">
|
|
@csrf
|
|
|
|
<div class="mb-4">
|
|
<label for="file_category_id" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.file_category') }} *</label>
|
|
<select name="file_category_id" id="file_category_id" required class="w-full px-3 py-2 border border-gray-300 rounded-md">
|
|
<option value="">{{ __('admin.select_category') }}</option>
|
|
@foreach ($categories as $cat)
|
|
<option value="{{ $cat->id }}" {{ old('file_category_id') == $cat->id ? 'selected' : '' }}>{{ $cat->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('file_category_id')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label for="file" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.upload_file') }} *</label>
|
|
<div x-data="{ fileName: '', dragging: false }" class="relative">
|
|
<div
|
|
@dragover.prevent="dragging = true"
|
|
@dragleave.prevent="dragging = false"
|
|
@drop.prevent="dragging = false; $refs.fileInput.files = $event.dataTransfer.files; fileName = $refs.fileInput.files[0]?.name || ''"
|
|
:class="dragging ? 'border-blue-400 bg-blue-50' : 'border-gray-300'"
|
|
class="border-2 border-dashed rounded-lg p-8 text-center cursor-pointer hover:border-blue-400 transition-colors"
|
|
@click="$refs.fileInput.click()">
|
|
<svg class="mx-auto h-10 w-10 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5" />
|
|
</svg>
|
|
<p class="mt-2 text-sm text-gray-600" x-show="!fileName">{{ __('admin.allowed_file_types') }}</p>
|
|
<p class="mt-1 text-xs text-gray-500" x-show="!fileName">{{ __('admin.max_file_size') }}</p>
|
|
<p class="mt-2 text-sm font-medium text-blue-600" x-show="fileName" x-text="fileName"></p>
|
|
</div>
|
|
<input type="file" name="file" id="file" x-ref="fileInput" class="hidden"
|
|
accept=".pdf,.docx,.xlsx,.jpg,.jpeg,.png,.gif,.webp"
|
|
@change="fileName = $refs.fileInput.files[0]?.name || ''">
|
|
</div>
|
|
@error('file')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
|
|
</div>
|
|
|
|
<div class="flex items-center gap-3">
|
|
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium">{{ __('admin.upload_file') }}</button>
|
|
<a href="{{ route('admin.files.index') }}" class="text-sm text-gray-600 hover:underline">{{ __('ui.cancel') }}</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</x-layouts.admin>
|