I have input $data =['identifier' = 'xxxxxxxxxx'];
, and want to save the encrypt($data['identifier'])
to the table info
primary id
column.
I've to validate before save it. Rule unique:info, id
isn't suitable here, so I want to write a custom validation rule. And in the custom validation rule, I encrypt()
the value first, then use the unique
validation rule.
I know how to write a custom validation rule, but how to use the unique
validation rule in my custom validation rule?