teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2020/09/13 15:04

投稿

phper.k
phper.k

スコア3923

answer CHANGED
@@ -6,4 +6,7 @@
6
6
 
7
7
  - Route::get('hello','HelloController@index');
8
8
  + Route::get('hello', [HelloController::class, 'index']);
9
- ```
9
+ ```
10
+
11
+ version 8 からルーティングの書き方が変わってます。
12
+ 書籍を参考にするなら、書籍のバージョンと合わせて学習すべきです。

1

修正

2020/09/13 15:03

投稿

phper.k
phper.k

スコア3923

answer CHANGED
@@ -5,5 +5,5 @@
5
5
  use App\Http\Middleware\HelloMiddleware;
6
6
 
7
7
  - Route::get('hello','HelloController@index');
8
- + Route::get('hello', ['HelloController', 'index']);
8
+ + Route::get('hello', [HelloController::class, 'index']);
9
9
  ```