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

質問編集履歴

7

add.blade.phpの記載

2021/07/06 23:10

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -56,6 +56,7 @@
56
56
 
57
57
 
58
58
  ```add.blade.php
59
+ add.blade.php
59
60
 
60
61
  @extends('layouts.helloapp')
61
62
 

6

add.blade.phpの情報を変更しました

2021/07/06 23:10

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -57,52 +57,37 @@
57
57
 
58
58
  ```add.blade.php
59
59
 
60
- add.blade.php
61
-
62
60
  @extends('layouts.helloapp')
63
61
 
64
- @section('title','Index')
62
+ @section('title', 'Add')
65
63
 
66
64
  @section('menubar')
67
- @parent
65
+ @parent
68
- インデックスページ
66
+ 新規作成ページ
69
67
  @endsection
70
68
 
71
69
  @section('content')
70
+ <form action="/hello/add" method="post">
72
71
  <table>
72
+ @csrf
73
- <tr><th>Name</th><th>Mail</th><th>Age</th></tr>
73
+ <tr><th>name: </th><td><input type="text" name="name"></td></tr>
74
- @foreach ($items as $item)
75
- <tr>
76
- <td>{{$item->name}}</td>
77
- <td>{{$item->mail}}</td>
74
+ <tr><th>mail: </th><td><input type="text" name="mail"></td></tr>
78
- <td>{{$item->age}}</td>
75
+ <tr><th>age: </th><td><input type="text" name="age"></td></tr>
79
- </tr>
76
+ <tr><th></th><td><input type="submit" value="send"></td></tr>
80
- @endforeach
81
- </table>
77
+ </table>
82
78
  </form>
83
79
  @endsection
84
80
 
81
+ @section('footer')
82
+ copyright 2020 tuyano.
83
+ @endsection
85
84
 
86
85
 
87
- {{-- @include('components.message',['msg_title'=>'OK',
88
- 'msg_content'=>'サブビューです。']) --}}
89
86
 
90
- {{-- @component('components.message')
91
- @slot('msg_title')
92
- CAUTION!
93
- @endslot
87
+ @endsection
94
88
 
95
- @slot('msg_content')
96
- これはメッセージの表示です。
97
- @endslot
98
- @endcomponent --}}
99
89
 
100
90
 
101
- @section('footer')
102
- copyright 2020 tuyano.
103
- @endsection
104
-
105
-
106
91
  ```
107
92
 
108
93
  ```index.blade.php

5

index.blade.phpの情報を追加しました。

2021/07/06 23:08

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -105,6 +105,41 @@
105
105
 
106
106
  ```
107
107
 
108
+ ```index.blade.php
109
+ index.blade.php
110
+
111
+
112
+ @extends('layouts.helloapp')
113
+
114
+ @section('title','Index')
115
+
116
+ @section('menubar')
117
+ @parent
118
+ インデックスページ
119
+ @endsection
120
+
121
+ @section('content')
122
+ <table>
123
+ <tr><th>Name</th><th>Mail</th><th>Age</th></tr>
124
+ @foreach ($items as $item)
125
+ <tr>
126
+ <td>{{$item->name}}</td>
127
+ <td>{{$item->mail}}</td>
128
+ <td>{{$item->age}}</td>
129
+ </tr>
130
+ @endforeach
131
+ </table>
132
+ </form>
133
+ @endsection
134
+
135
+ @section('footer')
136
+ copyright 2020 tuyano.
137
+ @endsection
138
+
139
+ ```
140
+
141
+
142
+
108
143
  ```web.php
109
144
  web.php
110
145
 

4

新しくページを開き直したりもしましたがダメでした。

2021/07/06 23:05

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -123,5 +123,7 @@
123
123
  ```
124
124
  ### 試したこと
125
125
  web.phpが誤っているのではないかと思ったのですが自分が見たかぎり
126
+ 問題なさそうでした・・新しくページを開き直したりもしましたがダメでした。
127
+
126
- 問題なさそうでした・・初心者で質問の仕方が下手で申し訳ありませんが、
128
+ 初心者で質問の仕方が下手で申し訳ありませんが、
127
129
  どなたかご回答いただけたら幸いです。よろしくお願い致します。

3

index.blade.php→add.blade.php

2021/07/06 10:41

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -57,7 +57,7 @@
57
57
 
58
58
  ```add.blade.php
59
59
 
60
- index.blade.php
60
+ add.blade.php
61
61
 
62
62
  @extends('layouts.helloapp')
63
63
 

2

index.blade.php→add.blade.php

2021/07/06 10:23

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -55,7 +55,7 @@
55
55
  ```
56
56
 
57
57
 
58
- ```index.blade.php
58
+ ```add.blade.php
59
59
 
60
60
  index.blade.php
61
61
 

1

、、

2021/07/06 10:21

投稿

S____00000
S____00000

スコア2

title CHANGED
File without changes
body CHANGED
@@ -53,7 +53,12 @@
53
53
  }
54
54
 
55
55
  ```
56
+
57
+
56
58
  ```index.blade.php
59
+
60
+ index.blade.php
61
+
57
62
  @extends('layouts.helloapp')
58
63
 
59
64
  @section('title','Index')
@@ -99,7 +104,11 @@
99
104
 
100
105
 
101
106
  ```
107
+
102
108
  ```web.php
109
+ web.php
110
+
111
+
103
112
  <?php
104
113
  use Illuminate\Support\Facades\Route;
105
114
  use App\Http\Controllers\PostController;