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

回答編集履歴

1

追記

2020/09/02 10:00

投稿

phper.k
phper.k

スコア3923

answer CHANGED
@@ -37,4 +37,29 @@
37
37
  ]);
38
38
  }
39
39
  }
40
+ ```
41
+
42
+ ```php
43
+
44
+ <table class="table table-condensed table-striped">
45
+ <th>部署名</th>
46
+ <th>所属スタッフ</th>
47
+ <tbody id="sort_items">
48
+ @foreach ($depts as $dept)
49
+ <tr id="item_{{ $dept->id }}" class="sort_item">
50
+ <td>{{ $dept->name }}</td>
51
+ <td>
52
+ // ここに東西で分けてスタッフを表示したい
53
+ @foreach($dept->staffs as $staff)
54
+ @if(.....)
55
+ ...
56
+ @else
57
+ ...
58
+ @endif
59
+ @endforeach
60
+ </td>
61
+ </tr>
62
+ @endforeach
63
+ </tbody>
64
+ </table>
40
65
  ```