Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Validation in update (store would be the same, but without unique ignore) - see:
public function update(Request $request, $id)
$messages = [
'orcid.unique' => 'This ORCID ID is already in use in our database',
'orcid.regex' => 'The ORCID ID is in the format',
//require more complex validation style to have unique ignore rule for ORCID
Validator::make($request->all(), [ //request->all() returns array required by Validator::make
'orcid' => [
'regex:/^http[s]?:\/\/\/(\d{4})-(\d{4})-(\d{4})-(\d{3}[0-9X])$/', //from:
new Orcid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment