Max size upload file

This commit is contained in:
ivan-sim
2024-02-06 10:27:06 +07:00
parent 826d4eb2a3
commit 975cd46f58
6 changed files with 17 additions and 7 deletions

View File

@@ -324,10 +324,16 @@ class RequestLogController extends Controller
];
$validator = Validator::make($request->all(), [
'request_logs_id' => 'required',
'discharge_date' => 'required'
'discharge_date' => 'required',
'result_files.*' => 'max:10000',
'diagnosa_files.*' => 'max:10000',
'kondisi_files.*' => 'max:10000',
], [
'request_logs_id.required' => trans('Validation.required',['attribute' => 'Request Logs ID']),
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date'])
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
'result_files.*.max' => trans('Validation.max.file', ['attribute' => 'Result Files', 'max' => '10 MB' ]),
'diagnosa_files.*.max' => trans('Validation.max.file', ['attribute' => 'Diagnosis Files', 'max' => '10 MB' ]),
'kondisi_files.*.max' => trans('Validation.max.file', ['attribute' => 'Condition Files', 'max' => '10 MB' ]),
]);
if ($validator->fails())
{

View File

@@ -333,7 +333,7 @@ export default function TableListFinalLog() {
const response = await axios.get(`/get-final-log`, {
params: { ...parameters, search:searchText, order: order,
orderBy: orderBy, type: 'final-log' },
orderBy: orderBy, status:statusValue, type: 'final-log' },
});
setData(
response.data.data.map((obj: any) => ({

View File

@@ -326,7 +326,7 @@ export default function TableList() {
const response = await axios.get(`/get-request-log`, {
params: { ...parameters, search:searchText, order: order,
orderBy: orderBy, type: 'request-log' },
orderBy: orderBy, status:statusValue, type: 'request-log' },
});
setData(
response.data.data.map((obj: any) => ({

View File

@@ -3,7 +3,7 @@
return [
'success' => 'Request has been successfully processed.',
'server_error' => 'Internal server error.',
'not_found' => 'Data not found',
'not_found' => 'Data not found.',
'password' => 'Password wrong. Please try again.',
'read_notification' => 'Notification has been read.',
'already_exists' => 'Data already exists.',

View File

@@ -3,6 +3,8 @@
return [
'required' => 'The :attribute field is required.',
'invalid' => 'The :attribute field is invalid.',
'max' => ':attribute cannot exceed :length characters.',
'max' => [
'file' => ':attribute max size is :max.',
],
'email' => 'Invalid email format.'
];

View File

@@ -3,6 +3,8 @@
return [
'required' => 'Kolom :attribute harus diisi.',
'invalid' => 'Kolom :attribute tidak valid.',
'max' => ':attribute tidak boleh melebihi :length karakter.',
'max' => [
'file' => ':attribute tidak boleh melebihi :max.',
],
'email' => 'Format email salah.'
];