質問編集履歴
1
試したことを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -93,4 +93,31 @@
|
|
93
93
|
</tr>
|
94
94
|
</tbody>
|
95
95
|
@endforeach
|
96
|
+
```
|
97
|
+
|
98
|
+
# 追記
|
99
|
+
現在試していることを共有します
|
100
|
+
|
101
|
+
フォロー中のみは出せたのですが
|
102
|
+
`@else`フォローなしの分岐表示を書くと
|
103
|
+
2重にデータが表示されてしまう問題が発生しました。
|
104
|
+
|
105
|
+

|
106
|
+
|
107
|
+
```html
|
108
|
+
@foreach($follows as $follow)
|
109
|
+
@if($authUser->id === $follow->user_id)
|
110
|
+
@foreach($users as $user)
|
111
|
+
@if($follow->follow_id === $user->id)
|
112
|
+
【フォロー中】
|
113
|
+
{{ $user->id }}: {{ $user->name }}<br />
|
114
|
+
E-mail: {{ $user->email }}<br />
|
115
|
+
@else
|
116
|
+
【フォローなし】
|
117
|
+
{{ $user->id }}: {{ $user->name }}<br />
|
118
|
+
E-mail: {{ $user->email }}<br />
|
119
|
+
@endif
|
120
|
+
@endforeach
|
121
|
+
@endif
|
122
|
+
@endforeach
|
96
123
|
```
|