パラメーターとして数値しか受け付けないという制限をつける

Route::get('/posts/{post}', [PostController::class, 'show'])
    ->name('posts.show')
    ->where('post', '[0-9]+');

参考:ドットインストール『Laravel 8入門 CRUD処理編』