Hello World 示例(基礎)

開啟路線檔案。將以下程式碼貼上到:

Route::get('helloworld', function () {
    return '<h1>Hello World</h1>';
});

在路線 http://localhost/helloworld 後,它會顯示 Hello World。

路線檔案位於/routes/web.php