0
I would like a suggestion on how to implement relation between tables in the Laravel using Migration.
public function up()
{
Schema::create('professors', function (Blueprint $table) {
$table->increments('id');
$table->string('id_professor');
$table->string('nome');
$table->string('data_nascimento');
$table->timestamps();
});
}
public function up()
{
Schema::create('courses', function (Blueprint $table) {
$table->increments('id');
$table->string('id_curso');
$table->string('nome');
$table->string('id_professor');
$table->timestamps();
});
}
public function up()
{
Schema::create('students', function (Blueprint $table) {
$table->increments('id');
$table->string('id_aluno');
$table->string('nome');
$table->string('data_nascimento');
$table->string('logradouro');
$table->string('numero');
$table->string('bairro');
$table->string('cidade');
$table->string('estado');
$table->string('cep');
$table->string('id_curso');
$table->timestamps();
});
}
What specifically do you want? It’s not very clear. Edit the question and add more information.
– Wallace Maxters
id_professor
so that if you already haveid
? You intend to have two primary keys for the same table?– Wallace Maxters
I wanted to ask how I can relate the tables in the id_curso lines, id_professor.
– Apach3
Edit the question and put this information, so I could answer for you.
– Wallace Maxters