The system I'm servicing has CPFs registered in two ways, with and without punctuation, due to poor start-up that did not impose a standard. The problem is that the CPF can not be repeated, and when the user types a CPF with no punctuation, if it is already recorded with punctuation, it will indicate that it is a new CPF.
I think I should use regex to compare the two, but I do not know how to apply to the query. Here is the query:
$customer = Customer::where('cpf', $valor)->first();