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

質問編集履歴

2

タイトルを変えました

2020/10/07 16:13

投稿

kazuma-shino
kazuma-shino

スコア1

title CHANGED
@@ -1,1 +1,1 @@
1
- laravel ログインユーザーごとの一覧表示機能につ
1
+ laravel ログインユーザーごとの一覧表示機能ができな
body CHANGED
File without changes

1

一覧表示のviewのソースを追加しました。

2020/10/07 16:13

投稿

kazuma-shino
kazuma-shino

スコア1

title CHANGED
File without changes
body CHANGED
@@ -41,6 +41,30 @@
41
41
  ```
42
42
  コントローラーの部分で以上のようにしています。
43
43
 
44
+ 一覧表示に用いるviewの該当ソースは以下の通りです
45
+ ```
46
+ <div class="container">
47
+ <table class="table">
48
+ <tbody>
49
+ @foreach($clothes as $cloth)
50
+ <tr>
51
+ <th scope="row">{{$cloth->image}}</th>
52
+ <td>{{$cloth->category}}</td>
53
+ <td>{{$cloth->name}}</td>
54
+ <td>{{$cloth->category}}</td>
55
+ <td>{{$cloth->size}}</td>
56
+ <td>
57
+ <a href="/cloth/{{$cloth->id}}" class="btn btn-primary btn-sm">詳細</a>
58
+ <a href="" class="btn btn-primary btn-sm">編集</a>
59
+ <a href="" class="btn btn-danger btn-sm">削除</a>
60
+ </td>
61
+ </tr>
62
+ @endforeach
63
+ </tbody>
64
+ </table>
65
+ </div>
66
+ ```
67
+
44
68
  ### 試したこと
45
69
 
46
70
  phpmyadminを確認すると、データは登録されており、user_idも登録されています。