*/ protected $fillable = [ 'name', 'email', 'username', // Ditambahkan 'password', 'role', // Ditambahkan 'role_id', // Ditambahkan ]; /** * 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', ]; // Helper method untuk cek role public function isAdmin() { return $this->role === 'admin'; } public function isSantri() { return $this->role === 'santri'; } public function isWali() { return $this->role === 'wali'; } }