Now, I do trim for each input separately like below code:
$username = trim(Input::get('username'));
$password = trim(Input::get('password'));
$email = trim(Input::get('email'));
$validator = Validator::make(array('username' => $username,
'password' => $password,
'email' => $email),
array('username' => 'required|min:6',
'password' => 'required|min:6',
'email' => 'email'));
Is any approach to do Trim at the same time with
Input::all()
or Input::only('username', 'password', 'email')
?
And what is the best practice to do this?
See Question&Answers more detail:os