rully
2 months ago
197
0
Laravel

Laravel Relations foreign key

Posted 2 months ago by rully

$table->bigIncrements('id'); $table->unsignedBigInteger('siswa_id'); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('nik_nisn'); $table->string('type'); $table->string('password'); $table->rememberToken(); $table->timestamps(); $table->foreign('siswa_id')->references('id')->on('siswa');

how do i do relations in users table? while the email field is unique, when I keep trying an error occurs. maybe the error appears because the email field is unique. Any suggestions for me?

Please sign in or create an account to participate in this conversation.