php - Laravel 5 Validation Trim -


i beginner in laravel 5.

how can remove whitespaces in validator?? have read documentation there no validator trim(remove whitespaces).

here rules

$rules = [         'name' =>'required',         'email' => 'required|email',         'address' => 'required',         'phones' => 'required'     ]; 

thanks answer.

it's not job validator change input data. trim validator exists in codeigniter, me isn't right place perform trim.

you can automatically trim input using using this:

input::merge(array_map('trim', input::all())); 

now rest of coding:

$username = input::get('username'); // it's trimed  // ... validator::make(...); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -