// Document comes from a Leandro Ferreira package for document fields in pt_BR
Document::make('cpf')
->label('CPF')
->live()
->cpf('999.999.999-99')
->dehydrateStateUsing(fn(string $state): string => preg_replace('/[.-]+/', '', $state))
->unique()
->required()
->live()
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Document $component) {
$livewire->validateOnly($component->getStatePath());
}),
// Document comes from a Leandro Ferreira package for document fields in pt_BR
Document::make('cpf')
->label('CPF')
->live()
->cpf('999.999.999-99')
->dehydrateStateUsing(fn(string $state): string => preg_replace('/[.-]+/', '', $state))
->unique()
->required()
->live()
->afterStateUpdated(function (Forms\Contracts\HasForms $livewire, Document $component) {
$livewire->validateOnly($component->getStatePath());
}),