I have a Livewire component which asks for different information in a multi-step form during sign up:
class Signup extends Component
{
#[Validate('required|email::rfc,dns', as: 'email address')]
public $email;
#[Validate('required', as: 'verification code')]
public $code;
...
In the function below I want to validate only $email:
public function checkEmail(): void
{
// Sanitize form values
$this->email = UserService::sanitizeValue('email', $this->email);
$this->validate();
Is there a way to do it?
It's possible to validate a single attribute using the validateOnly() method:
$this->validateOnly('email');