I tried to tuck away the fields needed for my registration process with the new Livewire Form Objects.
namespace App\Livewire;
use Livewire\Component;
use App\Livewire\Forms\RegistrationForm;
class Registration extends Component
{
public RegistrationForm $form;
...
}
Due to that nesting, the field handles used for validation get prefixed with form. (e.g. form.email) and therefore checking for existing users with unique_user_value always passes since there is no user with form.email set.
// App/Livewire/Forms/RegistrationForm.php
#[Rule("required|email|unique_user_value")]
public string $email;
It would be great if there was a way to pass along the column (e.g. email) to be validated on.
I tried to tuck away the fields needed for my registration process with the new Livewire Form Objects.
Due to that nesting, the field handles used for validation get prefixed with
form.
(e.g.form.email
) and therefore checking for existing users withunique_user_value
always passes since there is no user withform.email
set.It would be great if there was a way to pass along the column (e.g.
email
) to be validated on.