*/ use HasFactory, Notifiable, HasRoles, HasUuids; public function canAccessPanel(Panel $panel): bool { return $this->hasAnyRole(['admin', 'super_admin', 'bendahara', 'editor', 'sensei']); } /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'avatar_url', 'xp_points', 'current_streak', 'metadata', ]; /** * Get the social accounts for the user. */ public function socialAccounts(): HasMany { return $this->hasMany(SocialAccount::class); } /** * Get the enrollments for the user. */ public function enrollments(): HasMany { return $this->hasMany(Enrollment::class); } /** * Get the progress for the user. */ public function userProgress(): HasMany { return $this->hasMany(UserProgress::class); } /** * The attributes that should be hidden for serialization. * * @var list */ 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', 'last_activity_at' => 'datetime', ]; } }