回答編集履歴

1

誤字

2020/09/14 22:13

投稿

tenlife
tenlife

スコア70

test CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  ```controller
4
4
 
5
- $private_items = Item::withoutGlobalScopes()->get();
6
-
7
- $private_items = $private_items->where('status', '1');
5
+ $private_items = $user->items()->withoutGlobalScopes()->where('status', '1')->get();
8
6
 
9
7
  ```
10
8
 
@@ -16,11 +14,11 @@
16
14
 
17
15
  ```ここに言語を入力
18
16
 
19
- $private_items = Item::withoutGlobalScopes()->get();
17
+ $private_items = $user->items()->withoutGlobalScopes()->where('status', '1')->get();
20
18
 
21
19
  ⬇️
22
20
 
23
- $private_items = Item::withoutGlobalScopes(ScopeItem::class)->get();
21
+ $private_items = $user->items()->withoutGlobalScopes(ScopeItem::class)->where('status', '1')->get();
24
22
 
25
23
  ```
26
24