*/ 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); } }