*/ use HasFactory, Notifiable; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function penyewaans(): HasMany { return $this->hasMany(Penyewaan::class); } public function loginHistories(): HasMany { return $this->hasMany(LoginHistory::class); } public function isAdmin(): bool { return $this->role === 'admin'; } public function isUser(): bool { return $this->role === 'user'; } }