From c1105f0b51afc04c68758945108eb08d754ae8fa Mon Sep 17 00:00:00 2001 From: Mateus Junges Date: Mon, 16 Dec 2024 19:36:08 -0300 Subject: [PATCH] Ensure id is always integer --- routes/web.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index e3a8d16..3ae464c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,13 +4,18 @@ use App\Http\Controllers\IssueController; use App\Http\Controllers\ProjectController; use App\Http\Controllers\PullRequestController; +use Illuminate\Support\Facades\Route; Route::get('/', [ProjectController::class, 'index'])->name('projects.index'); Route::prefix('projects/{vendor}/{name}')->group(function () { Route::get('/', [ProjectController::class, 'show'])->name('projects.show'); - Route::get('issues/{id}', [IssueController::class, 'show'])->name('issue.show'); - Route::get('prs/{id}', [PullRequestController::class, 'show'])->name('pull-request.show'); + Route::get('issues/{id}', [IssueController::class, 'show']) + ->where('id', '[0-9]+') + ->name('issue.show'); + Route::get('prs/{id}', [PullRequestController::class, 'show']) + ->where('id', '[0-9]+') + ->name('pull-request.show'); }); Route::get('auth/redirect', [LoginController::class, 'redirectToProvider'])->name('auth.github');