*/ use HasFactory, Notifiable, HasRoles; public const ROLE_ADMIN = 'admin'; public const ROLE_MAHASISWA = 'mahasiswa'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'nim', 'name', 'email', 'password', 'id_angkatan', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function angkatan() { return $this->belongsTo(Angkatan::class, 'id_angkatan'); } public function submission() { return $this->hasMany(Submissions::class, 'id'); } }