質問編集履歴

3

修正

2020/12/22 12:32

投稿

renren643
renren643

スコア279

test CHANGED
File without changes
test CHANGED
@@ -10,23 +10,13 @@
10
10
 
11
11
  // LengthAwarePaginatorが帰ってくる
12
12
 
13
- $posts = Post::getPosts();
13
+ $posts = \App\Models\Post::with('comments')->paginate(10);
14
14
 
15
15
  $posts->makeHidden(['hoge', 'fuga']);
16
16
 
17
17
  return response()->success($posts);
18
18
 
19
19
 
20
-
21
-
22
-
23
- public function getPosts(Request $request, $buildingId): Response
24
-
25
- {
26
-
27
- return \App\Models\Post::with('comments')->paginate(10);
28
-
29
- }
30
20
 
31
21
  ```
32
22
 

2

修正

2020/12/22 12:32

投稿

renren643
renren643

スコア279

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  {
26
26
 
27
-
27
+ return \App\Models\Post::with('comments')->paginate(10);
28
28
 
29
29
  }
30
30
 

1

修正

2020/12/22 12:31

投稿

renren643
renren643

スコア279

test CHANGED
File without changes
test CHANGED
@@ -15,6 +15,18 @@
15
15
  $posts->makeHidden(['hoge', 'fuga']);
16
16
 
17
17
  return response()->success($posts);
18
+
19
+
20
+
21
+
22
+
23
+ public function getPosts(Request $request, $buildingId): Response
24
+
25
+ {
26
+
27
+
28
+
29
+ }
18
30
 
19
31
  ```
20
32