how to change input text value before unique validation?

before do unique validation i want to standardise the text input value like lowercase it.etc. How do i do so before apply unique validation? in a filament text input? Something like this if it is a normal form request
function prepareForValidation(

$this->mobile_phone = (new PhoneNumber($this->mobile_phone, 'US')->formatE164();

}
function prepareForValidation(

$this->mobile_phone = (new PhoneNumber($this->mobile_phone, 'US')->formatE164();

}
Then apply unique validation later
9 Replies
Somebody
SomebodyOP16mo ago
im using filament forms outside panel
Somebody
SomebodyOP16mo ago
masking is javascript, would prefer a server side hook to do the changes to the value before the field validation
Vp
Vp16mo ago
Then create your own logic, like updatedTitle() ref https://livewire.laravel.com/docs/lifecycle-hooks
Laravel
Lifecycle Hooks | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Somebody
SomebodyOP16mo ago
i don't want to do it on every update, but when user press submit and just before the validation run for mobile_phone
Vp
Vp16mo ago
No idea then, sorry
krekas
krekas16mo ago
instead of doing it live() do it live(onBlur: true then it will be triggered after focus removed

Did you find this page helpful?