refactor: add regex validation for 'nama' field in BookingFotoRequest
This commit is contained in:
parent
3c2d078e8f
commit
f140a6b481
|
|
@ -17,7 +17,7 @@ public function rules(): array
|
|||
'id_paket' => 'required|exists:paket_fotos,id_paket',
|
||||
'tgl_booking' => 'required|date|after_or_equal:today',
|
||||
'jam_mulai' => 'required',
|
||||
'nama' => 'required|string|min:3|max:100',
|
||||
'nama' => 'required|string|min:3|max:100|regex:/^[a-zA-Z\s]+$/',
|
||||
'no_wa' => 'required|numeric|digits_between:10,15',
|
||||
'bukti_bayar' => 'required|image|mimes:jpeg,png,jpg|max:2048',
|
||||
];
|
||||
|
|
@ -37,6 +37,7 @@ public function messages(): array
|
|||
'after_or_equal' => ':attribute tidak boleh tanggal yang sudah lewat.',
|
||||
'mimes' => 'Format :attribute harus jpeg, png, atau jpg.',
|
||||
'bukti_bayar.max' => 'Ukuran :attribute maksimal adalah 2MB.',
|
||||
'regex' => ':attribute hanya boleh berisi huruf dan spasi.',
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue