response() ->success('导入成功') ->redirect('/admission_new_students'); } catch (ValidationException $validationException) { return Response::withException($validationException); } catch (Throwable $throwable) { //dcat 2.0写法 $this->response()->error(false); return $this->response()->error($throwable->getMessage())->refresh(); } } public function form() { $this->file('file', '上传Excel')->rules('required', ['required' => '文件不能为空']); } }