回答編集履歴

2

追記

2019/03/06 16:14

投稿

退会済みユーザー
test CHANGED
@@ -31,3 +31,19 @@
31
31
  @endforeach
32
32
 
33
33
  ```
34
+
35
+
36
+
37
+ ```php
38
+
39
+
40
+
41
+ public function user()
42
+
43
+ {
44
+
45
+ return $this->belongsTo('App\User')->withDefault();
46
+
47
+ }
48
+
49
+ ```

1

追記

2019/03/06 16:14

投稿

退会済みユーザー
test CHANGED
@@ -7,8 +7,6 @@
7
7
  public function index()
8
8
 
9
9
  {
10
-
11
- $all_posts = [];
12
10
 
13
11
  $posts = Post::with('photos', 'user')->get();
14
12