44 lines
949 B
PHP
44 lines
949 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Sidang extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'sidang';
|
|
|
|
protected $fillable = [
|
|
'id_mahasiswa',
|
|
'id_pengajuan',
|
|
'id_seminar_proposal',
|
|
'berkas',
|
|
];
|
|
|
|
// Relationship dengan model User (Mahasiswa)
|
|
public function mahasiswa()
|
|
{
|
|
return $this->belongsTo(User::class, 'id_mahasiswa');
|
|
}
|
|
|
|
// Relationship dengan model Pengajuan
|
|
public function pengajuan()
|
|
{
|
|
return $this->belongsTo(Pengajuan::class, 'id_pengajuan');
|
|
}
|
|
|
|
// Relationship dengan model SeminarProposal
|
|
public function seminarProposal()
|
|
{
|
|
return $this->belongsTo(SeminarProposal::class, 'id_seminar_proposal');
|
|
}
|
|
|
|
public function sidangJadwal()
|
|
{
|
|
return $this->hasMany(SidangJadwal::class, 'id_sidang');
|
|
}
|
|
}
|