size($filePath); $data['mime_type'] = Storage::disk('local')->mimeType($filePath); // 移除临时的 file 字段 unset($data['file']); } return $data; } protected function afterCreate(): void { // 文档创建后,触发转换任务 $conversionService = app(\App\Services\DocumentConversionService::class); $conversionService->queueConversion($this->record); } protected function getCreatedNotification(): ?Notification { return Notification::make() ->success() ->title('文档上传成功') ->body('文档已成功上传到知识库。'); } protected function getRedirectUrl(): string { return $this->getResource()::getUrl('index'); } }