Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel validate enum field

$validator = Validator::make(Input::only(['username', 'password', 'type']), [
    'type' => 'in:DEFAULT,SOCIAL', // DEFAULT or SOCIAL values
    'username' => 'required|min:6|max:255',
    'password' => 'required|min:6|max:255'
]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #validate #enum #field
ADD COMMENT
Topic
Name
2+7 =