'hashed' — hanya Laravel 10+ protected $casts = [ 'last_login' => 'datetime', ]; // Ganti dengan mutator manual public function setPasswordAttribute(string $value): void { // Cegah double hash if ( !str_starts_with($value, '$2y$') && !str_starts_with($value, '$argon2i$') && !str_starts_with($value, '$argon2id$') ) { $this->attributes['password'] = bcrypt($value); } else { $this->attributes['password'] = $value; } } public function santri() { return $this->belongsTo(Santri::class, 'id_santri', 'id_santri'); } public function isSantri(): bool { return $this->role === 'santri'; } public function isWali(): bool { return $this->role === 'wali'; } }