Yes the users table since it's tied to login, unless you change to using username.
Dec 23, 2022
2
Level 1
Basic issues of diagramming the database
Hello.
I have a basic question regarding how to structure tables with Laravel. That is, I have the general user table and a table with the user's contact data.
The proposal is the following
$a = Schema::create('user', function (Blueprint $table) {
$table->id();
$table->bigInteger('citizen_number')->unique();
$table->string('name');
$table->string('last_name');
$table->string('password');
});
}
this is the other table:
$a = Schema::create('user_contact ', function (Blueprint $table) {
$table->id();
$table->bigInteger('user_id')->unique();
$table->string('email');
$table->string('city');
$table->string('street');
$table->string('phone');
$table->foreign('user_id')->references('id')->on('user');
}
My question is the following, I have always seen that the email goes in the user table and here they have diagrammed it in the user contacts table. What do you think? it should be in user table? I see it as the email is related to the password so it should go in the same table but I don't know if it is a strong argument for them to change it.
Please or to participate in this conversation.