I wrote this code in file RouteServiceProvider.php that is located in app/Providers directory.
In method boot:
$this->pattern('{id}', '[0-9]+');
then according to what I read, I thought if I write this code:
Route::get('/user/{id}', function ($id){
return $id;
});
in file web.php in routes directory the id parameter accept just int value, but when i test this url: http://127.0.0.1:8000/user/a I saw a is returned.
Where is the problem and how can I make pattern?