Closed edukmattos closed 6 years ago
Sorry. I founded my error: 'name' => 'required|max:40|unique:users_collection,name,'.$this->_id.',_id,deleted_at,NULL',
My problem is that the laravel validation differentiates between upper and lower case characters, ie, CAR is different of the car. I need validation to consider CAR = car. Any suggestions ?
My problem is that the laravel validation differentiates between upper and lower case characters, ie, CAR is different of the car. I need validation to consider CAR = car. Any suggestions ?
Hi ! With MySQL it works and CouchDB does not.
Hi @ecmattos,
I don't see this as a problem. CouchDB treat the fields as case-sensitive, hence CAR is not equals car.
Why don't you treat your inputs before validating?
Either you start to store your data lower or upper case only or you will have to treatment your input before validating.
Maybe this can help you
'name' => Rule::unique('name')->where(function ($query) { $query->where('_id', strtoupper('car')); })
It worked ! Thanks !
HI ! Is this package works with Laravel Requests Rules ? My script: public function rules() { return [ 'name' => 'required|max:40|unique:users_collection,name,'.$this->_id.',id,deleted_at,NULL', 'fullname' => 'required|max:100|unique:users_collection,fullname,'.$this->_id.',id,deleted_at,NULL', 'email' => 'required|email|max:50|unique:users_collection,email,'.$this->_id.',id,deleted_at,NULL', 'role_id' => 'required' ]; } I created the same users and validation dont works ! Any suggestion ?