title: Laravel 4 : Best Practice to Trim Input before Validation
body: <p>Now, I do trim for each input separately like below code:</p>
  
  <pre><code>$username = trim(Input::get('username'));
  $password = trim(Input::get('password'));
  $email    = trim(Input::get('email'));
  
  $validator = Validator::make(array('username' =&gt; $username, 
                                     'password' =&gt; $password, 
                                     'email'    =&gt; $email), 
                               array('username' =&gt; 'required|min:6', 
                                     'password' =&gt; 'required|min:6', 
                                     'email'    =&gt; 'email'));
  </code></pre>
  
  <p>Is any approach to do Trim at the same time with</p>
  
  <p><code>Input::all()</code> or <code>Input::only('username', 'password', 'email')</code>?</p>
  
  <p>And what is the best practice to do this?</p>