*/ use HasFacehashAvatar, HasFactory, HasRoles, Notifiable, SoftDeletes; protected $guarded = ['id']; protected $hidden = [ 'password', ]; protected function casts(): array { return [ 'is_active' => IsActive::class, 'password' => 'hashed', ]; } #[Scope] protected function active(Builder $query): void { $query->where('is_active', IsActive::Active); } #[Scope] protected function inactive(Builder $query): void { $query->where('is_active', IsActive::Inactive); } public function canAccessPanel(Panel $panel): bool { return $this->is_active === IsActive::Active; } protected function name(): Attribute { return Attribute::make( get: fn () => $this->student?->full_name ); } public function student(): HasOne { return $this->hasOne(Student::class); } public function settings(): HasOne { return $this->hasOne(UserSetting::class)->withDefault([ 'notif_style' => NotifStyle::Cheerful, 'primary_color' => 'amber', // Cheerful yellow 'font' => 'Inter', 'content_width' => 'full', 'border_radius' => 'lg', 'top_navigation' => false, ]); } }