'required', 'guest_name' => 'required', 'phone' => 'required', 'email' => 'required', ]; } /** * Get the error messages for the defined validation rules. * * @return array */ public function messages() { return [ 'agents_code.required' => 'Mã đại lý không được để trống.', 'guest_name.required' => 'Tên khách hàng không được để trống.', 'phone.required' => 'SĐT không được để trống.', 'email.required' => 'Email không được để trống.' ]; } /** * Handle a failed validation attempt. * * @param \Illuminate\Contracts\Validation\Validator $validator * @return void * * @throws \Illuminate\Http\Exceptions\HttpResponseException */ protected function failedValidation(Validator $validator) { throw new HttpResponseException(response()->json([ 'status' => false, 'msg' => $validator->errors() ], 200)); } /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } }