1$rules = [
2 'name' => 'required',
3 'email' => 'required|email',
4 'message' => 'required|max:250',
5 ];
6
7 $customMessages = [
8 'required' => 'The :attribute field is required.'
9 ];
10
11 $this->validate($request, $rules, $customMessages);
1$this->validate([
2 'userid' =>'required|min:3|max:100',
3 'username' =>'required|min:3',
4 'password' =>'required|max:15|confirmed',
5], [], [
6 'userid' => 'User ID'
7]);
1$rules = [
2 'name' => 'required',
3 'email' => 'required|email',
4 'message' => 'required|max:250',
5 ];
6
7 $customMessages = [
8 'required' => 'The :attribute field is required.'
9 ];
10
11 $this->validate($request, $rules, $customMessages);
12//@sujay
1$messages = [
2 'exists' => 'Your custom message',
3 ];
4 $this->validate($request, [
5 'recovery_code' => 'required|exists:users,email_recovery_code',
6 'new_password'=>'required',
7 'confirm_password'=>'required|same:new_password',
8 ],$messages);