*/ protected $fillable = [ 'role_id', 'email', 'password', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; public function anggota() { // Setiap User memiliki satu data profil Anggota return $this->hasOne(Anggota::class, 'user_id'); } // Relasi ke tabel Role public function role() { return $this->belongsTo(Role::class, 'role_id'); } }