-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Needs investigationNeed investigation about bugs described in issueNeed investigation about bugs described in issuebug
Description
I've encountered an issue when using unique Validator. I'm using Laravel v5.2 & laravel-mongo v3.2.3. The following is the steps to reproduce:
Existing records in database:
{'name': "Banking"}
{'name': "Finance and Banking"}
Validation rule used:
$this->rules = ['name' => 'unique:brands,name,NULL,_id,deleted_at,NULL'];
Data to be validated before inserting:
{'name': "Finance"}
Expected validation result should be pass, but instead it failed. Upon further checking, the following line looks for unique value using case-insensitive regex, thus returning values that matches Finance
, in this case Finance and Banking
.
Upon changing to $this->table($collection)->where($column, $value);
will fix the problem
prashant-pokhriyal and HubertSadecki
Metadata
Metadata
Assignees
Labels
Needs investigationNeed investigation about bugs described in issueNeed investigation about bugs described in issuebug