add temporary file manager

This commit is contained in:
2026-02-19 19:47:42 +03:00
parent cf635f81dd
commit ad4a3367c3
9 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
@extends('layouts.app')
@section('content')
<div class="bg-white p-6 rounded-xl shadow-md space-y-4">
<h1 class="text-2xl font-bold text-gray-800">Временная ссылка на файл</h1>
@if (!$enabled)
<div class="p-3 bg-yellow-50 text-yellow-800 rounded-lg text-sm">
Функция отключена конфигом (`FILE_LINKS_ENABLED=false`).
</div>
@else
@if ($errors->any())
<div class="p-3 bg-red-50 text-red-700 rounded-lg text-sm">
{{ $errors->first() }}
</div>
@endif
@if (session('file_link'))
<div class="p-3 bg-green-50 text-green-800 rounded-lg text-sm break-all">
<p class="mb-2"><strong>Ссылка готова:</strong></p>
<p>
<a href="{{ session('file_link') }}" class="text-blue-600 hover:underline" target="_blank">
{{ session('file_link') }}
</a>
</p>
<p class="mt-2">Действует до: {{ session('file_expires_at') }}</p>
</div>
@endif
<form method="POST" action="{{ route('files.upload') }}" enctype="multipart/form-data" class="space-y-4">
@csrf
<div>
<label for="file" class="block text-gray-700 mb-1">Выберите файл</label>
<input id="file" type="file" name="file" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg">
</div>
<button type="submit"
class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2.5 px-4 rounded-lg transition">
Загрузить и получить ссылку
</button>
</form>
@endif
</div>
@endsection