-
-
Save tridungle/16b2f2dd19991ac9af9c9a989647ad93 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