Created
June 6, 2019 18:25
-
-
Save HigoRibeiro/b172bde79a6960d0e59eeda282d4a3bb to your computer and use it in GitHub Desktop.
Validação condicional
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
class Store { | |
get validateAll () { | |
return true | |
} | |
get rules () { | |
return { | |
...(this.ctx.request.input('name') ? { name : 'required' } : null), | |
email: 'required|email|unique:users', | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment