You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but the check for the unique key is ignored. I want to have a unique index based on the fields "code" and "company_id". If I try to insert twice the same "code" for the same "comapny_id" the rule doesn't fire as expected. In MongoDB fields are of type string for "code" and of type Int32 for "company_id". In above Rule::unique('mongodb.plico_user_groups', 'code') the "mongodb" part is the name of my connection and "plico_user_groups" is the name of the collection.
This discussion was converted from issue #2142 on December 02, 2020 04:00.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys,
I have the following validation rules on a store context:
'code' => [ 'required', 'max:30', Rule::unique('mongodb.plico_user_groups', 'code')->where('company_id', 1) ]
but the check for the unique key is ignored. I want to have a unique index based on the fields "code" and "company_id". If I try to insert twice the same "code" for the same "comapny_id" the rule doesn't fire as expected. In MongoDB fields are of type string for "code" and of type Int32 for "company_id". In above Rule::unique('mongodb.plico_user_groups', 'code') the "mongodb" part is the name of my connection and "plico_user_groups" is the name of the collection.
Please, someone can help?
Many thanks,
bye.
Beta Was this translation helpful? Give feedback.
All reactions