AWS、EC2にLaravelをインストールしました。
デフォルトで存在しているwelcome.blade.phpにはアクセスできているのですが
自分でweb.phpを編集したルーティングが効いていないみたいで困っています。
以下は簡単なHTMLを出力させようと書いたweb.phpとコントローラーです。
詳しい方がいらっしゃいましたらよろしくお願いいたします。
・web.php <?php Route::get('/', function () { ←もとから記述されていていたメソッド return view('welcome'); }); Route::get('/home', 'HelloController@index'); ←今回追記したもの。
・HelloController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class HelloController extends Controller { public function index(){ return <<<EOF <html> <head> <title>hoge</title> </head> <body> <h1>hoge</h1> </body> </html> EOF; } }
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/12 05:56