Below are my routes, when I try to access /ranks/weekly, ranks/monthly and ranks/list it assume weekly, monthly & list as IDs and request data from GET /ranks/{id} show function.
Route::get('ranks', [RankingController::class, 'index']);
Route::post('ranks', [RankingController::class, 'create']);
Route::get('ranks/{ranking}', [RankingController::class, 'show']);
Route::put('ranks/{ranking}', [RankingController::class, 'update']);
Route::delete('ranks/{ranking}', [RankingController::class, 'destroy']);
Route::get('ranks/list', [RankingController::class, 'plain']);
Route::get('ranks/weekly', [RankingController::class, 'weekly']);
Route::get('ranks/monthly', [RankingController::class, 'monthly']);
>Solution :
So the reason for this is that:
Route::get('ranks/{ranking}', [RankingController::class, 'show']);
conflicts with everything succeeding ranks (i.e. weekly and monthly) because that matches with that route too. Like I stated in the comment, you can put the most lenient match at the bottom or be a little bit more restrictive in the matching for example:
Route::get('ranks/{ranking}', [RankingController::class, 'show'])->where('ranking', '[0-9]+');
Hope that helps!