Support the ongoing development of Laravel.io →
Authentication Database Eloquent
Last updated 2 years ago.
0

I notice you're wanting a "User" table but you specified a "user" table.

Is the case affecting it?

0

lucabernardino said:

I notice you're wanting a "User" table but you specified a "user" table.

Is the case affecting it?

I'm not sure if casing matters or not, but in either case the user table in MySQL is lowercase as well as the casing in my auth.php and user model is lowercase. Everywhere I can find it's lower case. I thought I only needed to specify the table in my model and specify Eloquent as my driver...

0

Found the issue. Buried in App\Service\Registrar.php

public function validator(array $data)
	{
		return Validator::make($data, [
			'name' => 'required|max:255',
			'email' => 'required|email|max:255|unique:users',
			'password' => 'required|confirmed|min:6',
		]);
	}

in the 'email' => 'required|email|max:255|unique:users', you have to change the "unique:users" to "unique:user" or whatever your table name is. Apparently this line tells is that the email that your user enters must be a unique entry in the users table. After changing this to the correct table, the application allowed me to register.

zalnlol liked this reply

1

Very Helpful

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ATXcoder atxcoder Joined 15 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.