group(function () { Route::get('/login', [AuthController::class, 'showLogin'])->name('login'); Route::post('/login', [AuthController::class, 'login']); Route::get('/register', [AuthController::class, 'showRegister'])->name('register'); Route::post('/register', [AuthController::class, 'register']); }); // 登出路由 Route::post('/logout', [AuthController::class, 'logout'])->name('logout')->middleware('auth'); // 首页重定向 Route::get('/', function () { return redirect()->route('patients.reminders'); }); // 患者管理路由(需要登录) Route::prefix('patients')->name('patients.')->middleware('auth')->group(function () { // 列表 Route::get('/', [PatientController::class, 'index'])->name('index'); // 随访提醒 Route::get('/reminders', [PatientController::class, 'reminders'])->name('reminders'); // 导入 Route::get('/import', [PatientController::class, 'showImport'])->name('import'); Route::post('/import', [PatientController::class, 'import'])->name('import.store'); // 下载模板 Route::get('/template', [PatientController::class, 'downloadTemplate'])->name('template'); // 导出 Route::get('/export', [PatientController::class, 'export'])->name('export'); // 标记已随访 Route::post('/{patient}/follow-up', [PatientController::class, 'markFollowedUp'])->name('follow-up'); // 删除 Route::delete('/{patient}', [PatientController::class, 'destroy'])->name('destroy'); });