Last active
June 23, 2016 16:27
-
-
Save ceceprawiro/7bb6a443fd4a3042f0952b8fd103ff98 to your computer and use it in GitHub Desktop.
Laravel Form Validation combination of first and last name must be Unique
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function store(Request $request) | |
{ | |
$validator = Validator::make($request->all(), [ | |
'first_name' => 'required|max:100', | |
'last_name' => 'required|unique:user,last_name,NULL,id,first_name,'.$request->first_name.'|max:100', | |
]); | |
.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment