- Added `media-library.php` configuration file for managing media uploads and conversions. - Updated `filesystems.php` to set default visibility for AWS S3 storage. - Implemented `FileUpload` component for handling file uploads with preview and error handling. - Created `ImagePreviewModal` component for displaying image previews in a modal. - Introduced `Attachment` UI components for better file attachment handling. - Added `useFileUpload` hook to manage file upload state and logic. - Implemented utility functions for uploading files to S3 with presigned URLs. - Created API route for generating presigned URLs for file uploads.
32 lines
698 B
PHP
32 lines
698 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class PresignedUrlRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'file_name' => ['required', 'string', 'max:255'],
|
|
'mime_type' => ['required', 'string', 'in:image/jpeg,image/png,image/webp,image/gif'],
|
|
'folder' => ['nullable', 'string', 'max:100'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'file_name' => 'nama file',
|
|
'mime_type' => 'tipe file',
|
|
'folder' => 'folder',
|
|
];
|
|
}
|
|
}
|