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

回答編集履歴

3

誤字修正

2019/06/23 10:21

投稿

fumito_94
fumito_94

スコア679

answer CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  or
7
7
 
8
- return view('index', compact('hello');
8
+ return view('index', compact('hello'));
9
9
 
10
10
  or
11
11
 

2

viewへの渡し方を追加

2019/06/23 10:21

投稿

fumito_94
fumito_94

スコア679

answer CHANGED
@@ -2,6 +2,14 @@
2
2
  第二引数を配列にして変更しています。
3
3
  ```php
4
4
  return view('index', ['hello' => $hello]);
5
+
6
+ or
7
+
8
+ return view('index', compact('hello');
9
+
10
+ or
11
+
12
+ return view('index')->with('hello', $hello);
5
13
  ```
6
14
 
7
15
  [https://readouble.com/laravel/5.5/ja/views.html](https://readouble.com/laravel/5.5/ja/views.html)

1

サイト追加

2019/06/23 09:25

投稿

fumito_94
fumito_94

スコア679

answer CHANGED
@@ -2,4 +2,6 @@
2
2
  第二引数を配列にして変更しています。
3
3
  ```php
4
4
  return view('index', ['hello' => $hello]);
5
- ```
5
+ ```
6
+
7
+ [https://readouble.com/laravel/5.5/ja/views.html](https://readouble.com/laravel/5.5/ja/views.html)