Laravel IN Validation or Validation by ENUM Values

in:DEFAULT,SOCIAL
The field under validation must be included in the given list of values.

not_in:DEFAULT,SOCIAL
The field under validation must not be included in the given list of values.

$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'
]);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)