is_unique rule doesn't work with softDeletes |
When using the is_unique rule for validation like so:
Code: 'rules' => 'required|is_natural_no_zero|is_unique[teams.member_id]' It works okay, unless you set $softDeletes = true in the model. Then it will find the soft-deleted record, and it won't pass validation.
That is the way it is supposed to work. If you un-delete the original record, you now have a violation of table constraints, assuming you have set unique keys on that column.
|
Welcome Guest, Not a member yet? Register Sign In |