Giant Update

This commit is contained in:
Wian Drs
2026-07-31 13:57:11 +07:00
parent f68d967c8b
commit b0d08211ec
112 changed files with 6674 additions and 3 deletions
+6 -2
View File
@@ -13,11 +13,13 @@ class StoreFileRequest extends FormRequest
public function rules(): array
{
$maxSize = $this->input('category') === 'customer-image' ? 500 : 20480;
return [
'file' => [
'required',
'file',
'max:20480',
"max:{$maxSize}",
'mimes:jpg,jpeg,png,webp,gif,pdf,doc,docx,xls,xlsx,csv,txt,zip',
],
'category' => ['nullable', 'string', 'max:80', 'regex:/^[a-z0-9_-]+$/'],
@@ -27,7 +29,9 @@ class StoreFileRequest extends FormRequest
public function messages(): array
{
return [
'file.max' => 'Ukuran file maksimal 20 MB.',
'file.max' => $this->input('category') === 'customer-image'
? 'Gambar customer maksimal 500 KB setelah kompresi.'
: 'Ukuran file maksimal 20 MB.',
'file.mimes' => 'Jenis file tidak didukung.',
'category.regex' => 'Kategori hanya boleh berisi huruf kecil, angka, garis bawah, atau tanda hubung.',
];