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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -