So I have two forms on a single page. Login (email, password) and register (username, email, password). If I fill email on login form and click login, it displays the appropriate error message, but also fills the registration form email input and displays an error for password. Same applies for reverse.
What would be the best solution for this aside from the obvious one to create different pages for login and registration
Rename input names? For example: <input type="email" name="login_email"> and <input type="email" name="register_email">
Yes, but Eloquent would than look for login_email field in DB, which I don't have. Maybe there's a way around that?
I guess I could rename the fields in controller but that just creates an extra step and would probably ruin the $errors, since login_email wouldn't exist anymore.
My current solution is to just output a flash message without the errors.
You can set the column name on the rules example $rules = ['login_email' => 'unique:users,email'];
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community