Not sure if I am asking the question correctly, but if the user is optional, you should remove the 'required' from the validator. This way you will have:
'user' => 'unique:users|alpha_num',
instead:
'user' => 'unique:users|required|alpha_num',
, , .
:
private function getValidationRules($rules)
{
if ($rules == UPDATE_EMAIL)
{
return array('email' => 'required|email');
} else {
return array(
'user' => 'unique:users|required|alpha_num',
'email' => 'required|email'
);
}
}
, , , , , .
, .