How does the Route::resource of Laravel verify routing parameters?

< H2 > this allows < / H2 >

visit / users/1 pass, visit / users/a will 404

Route::pattern("id", "\d+");
Route::resource("users", "UserController", ["parameters" => [
    //  Id pattern 
    "user" => "id",
]]);
Nov.24,2021

Route::resource('users', 'UserController')->where(['user' => '\d+');

if it is only int, directly limit the parameter type to int in the controller's show method

Menu