1
The system where I am doing maintenance has Cpfs registered in two ways, with and without score, due to a bad development start that did not impose a standard. The problem is that the CPF cannot repeat itself, and when the user types a CPF without punctuation, if it is already recorded with punctuation, it will indicate that it is a new CPF.
I believe I should use regex to compare the two, but I don’t know how to apply it to the query. Below is the consultation held:
$customer = Customer::where('cpf', $valor)->first();
Wouldn’t it be better to fit all records to the correct standard?
– rray