这个方法比较简单粗暴,直接在后面加.html,在controller接收参数时用string $id方法。

Route::get('/post/{id}.html', [PostController::class, 'get']);

© 本文著作权归作者所有。转载请联系授权,禁止商用。