reminder/routes/web.php
2026-01-12 12:42:48 +08:00

47 lines
1.7 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PatientController;
use App\Http\Controllers\AuthController;
// 认证路由(未登录可访问)
Route::middleware('guest')->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');
});