Either you create a roles table where you store the id from the user together with a role id where the role id determines if the user is a doctor or patient or you can just create a doctors table where you store the ids of the doctors. If the id is not in the doctors table it's a patient.
Aug 16, 2020
1
Level 1
User Roles and tables connections
Hello I have a project that contain a doctor and a patient i have already made the authentication and when the doctors login the redirect to dashboard which is different than the patient dashboard
public function up() { Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name');
$table->boolean('isDoctor')->default(0); >>>> here i differentiate between the doctor and patient
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
but their information is stored in the same table which is user table. i want to make a doctor table and other patient table what is the relationship that i can connect the information of the doctor in the user table to the new doctor table ???
Please or to participate in this conversation.