I am a beginner in Laravel 5.
How can I remove whitespaces in validator?? i have read the documentation but there is no validator for trim(remove whitespaces).
It's not job for validator to change any input data. Trim validator exists in CodeIgniter, but as to me this isn't right place to perform trim.
You can automatically trim all input by using using this:
Input::merge(array_map('trim', Input::all()));
Now do the rest of your coding:
$username = Input::get('username'); // it's trimed
// ...
Validator::make(...);