filament-ptbr-form-fields
filament-ptbr-form-fields copied to clipboard
[Bug]: cpf_or_cnpj field is not saving properly on the database
What happened?
I expected cpf_or_cnpj field to save data on the database without the mask, and the dehydrateMask() method should be available in case I wanted to save the info with the mask.
How to reproduce the bug
Fill a cpf_or_cnpj field. Save it. Check it on the database - it is saved as 111.111.111-11 instead of 11111111111
Package Version
3.0.1
PHP Version
8.2.0
Laravel Version
10.3.3
Which operating systems does with happen with?
Windows
Notes
No response
Tenho o mesmo problema, resolvi adicionando no meu EditCustomer o seguinte:
protected function mutateFormDataBeforeSave(array $data): array
{
$data['document_number'] = preg_replace('/\D/', '', $data['document_number']);
return $data;
}
O ideal seria fazer isso no Model, não?