1. pastikan coba ganti di migrasi ke unsignedBigInteger.
eg :
$table->unsignedBigInteger('formal_education_id')->nullable();
$table->unsignedBigInteger('madin_education_id')->nullable();
$table->unsignedBigInteger('dormitory_id')->nullable();
2. pastikan tabel terarah dengan benar
eg: protected $table agar benar2 yakin nama table sama dg di DB
protected $table = 'madin_education';
public function students()
{
return $this->hasMany(Student::class);
}
3. penulisan method lebih baik camelCase jika terdiri dari beberapa kata
eg: madinEducation()
public function madinEducation()
{
return $this->belongsTo(MadinEducation::class);
}
4. sekarang coba panggil kembali relasinya. DONE :)
0 Komentar