add new validation rule and validation message in user pesan buket
This commit is contained in:
parent
660689cc10
commit
7334795e42
|
|
@ -14,9 +14,8 @@ public function authorize(): bool
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'id_buket' => 'required|exists:bukets,id_buket', // Tambahan validasi keamanan
|
||||
//tambahan validasi untuk teks aja
|
||||
'nama' => 'required|string|min:3|max:100|regex:/^[a-zA-Z\s]+$/',
|
||||
'id_buket' => 'required|exists:bukets,id_buket',
|
||||
'nama' => 'required|string|min:3|max:30|regex:/^[a-zA-Z\s]+$/',
|
||||
'no_wa' => 'required|numeric|digits_between:10,15',
|
||||
'tgl_ambil' => 'required|date|after_or_equal:today',
|
||||
'waktu_ambil' => [
|
||||
|
|
@ -26,16 +25,16 @@ public function rules(): array
|
|||
'before_or_equal:21:00',
|
||||
],
|
||||
'bukti_bayar' => 'required|image|mimes:jpeg,png,jpg|max:2048',
|
||||
'request_khusus' => 'nullable|string|max:250',
|
||||
'ucapan' => 'nullable|string|max:100',
|
||||
'request_khusus' => 'nullable|string|max:150',
|
||||
'ucapan' => 'nullable|string|max:150',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'required' => 'Kolom :attribute wajib diisi.',
|
||||
'string' => 'Input :attribute harus berupa teks valid.',
|
||||
'required' => ':attribute harus diisi.',
|
||||
'string' => ':attribute harus berupa teks valid.',
|
||||
'min' => ':attribute terlalu pendek, minimal :min karakter.',
|
||||
'max' => ':attribute terlalu panjang, maksimal :max karakter.',
|
||||
'numeric' => ':attribute harus berupa angka.',
|
||||
|
|
@ -48,6 +47,7 @@ public function messages(): array
|
|||
'bukti_bayar.max' => 'Ukuran :attribute maksimal adalah 2MB.',
|
||||
'waktu_ambil.after_or_equal' => 'Jam operasional kami mulai pukul 09:00.',
|
||||
'waktu_ambil.before_or_equal' => 'Jam operasional kami berakhir pukul 21:00.',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue