user(); // 如果是老师登录,自动设置 teacher_id if ($currentUser?->isTeacher() ?? false) { $data['teacher_id'] = $currentUser->teacher?->teacher_id; } return $data; } protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); } protected function getCreatedNotificationTitle(): ?string { return '学生创建成功'; } protected function getCreatedNotification(): ?\Filament\Notifications\Notification { return \Filament\Notifications\Notification::make() ->success() ->title('学生创建成功') ->body('学生信息已成功保存。'); } }