質問編集履歴
2
{{ csrf_field() }}のバージョン記述変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -102,242 +102,242 @@
|
|
102
102
|
|
103
103
|
</div>
|
104
104
|
|
105
|
+
{{ csrf_field() }}
|
106
|
+
|
107
|
+
<button type="submit" name="action" class="btn btn-primary" value="sent">送信する</button>
|
108
|
+
|
109
|
+
</form>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
@endsection
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
確認画面
|
122
|
+
|
123
|
+
```
|
124
|
+
|
125
|
+
@extends('layouts.app')
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
@section('content')
|
130
|
+
|
131
|
+
<div class="container">
|
132
|
+
|
133
|
+
<div class="row">
|
134
|
+
|
135
|
+
<h1>お問い合わせ内容の確認</h1>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="row">
|
140
|
+
|
141
|
+
<p>下記、お問い合わせ内容にて送信します。よろしければ「送信」ボタンを押して下さい。</p>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<table class="table table-bordered">
|
146
|
+
|
147
|
+
<tr>
|
148
|
+
|
149
|
+
<td class="table-secondary" style="width:20%">名前</td>
|
150
|
+
|
151
|
+
<td>{{ $name }}</td>
|
152
|
+
|
153
|
+
</tr>
|
154
|
+
|
155
|
+
<tr>
|
156
|
+
|
157
|
+
<td class="table-secondary" style="width:20%">メールアドレス</td>
|
158
|
+
|
159
|
+
<td>{{ $email }}</td>
|
160
|
+
|
161
|
+
</tr>
|
162
|
+
|
163
|
+
<tr>
|
164
|
+
|
165
|
+
<td class="table-secondary">件名</td>
|
166
|
+
|
167
|
+
<td>{{ $type }}</td>
|
168
|
+
|
169
|
+
</tr>
|
170
|
+
|
171
|
+
<tr>
|
172
|
+
|
173
|
+
<td class="table-secondary">メッセージ</td>
|
174
|
+
|
175
|
+
<td>{!! nl2br(e(body)) !!}</td>
|
176
|
+
|
177
|
+
</tr>
|
178
|
+
|
179
|
+
</table>
|
180
|
+
|
181
|
+
<form action="sent" method="post">
|
182
|
+
|
183
|
+
<input type="hidden" name="name" class="form-control" id="InputName" value="{{ $name }}">
|
184
|
+
|
185
|
+
<input type="hidden" name="email" class="form-control" id="InputEmail" value="{{ $email }}">
|
186
|
+
|
187
|
+
<input type="hidden" name="type" class="form-control" id="InputType" value="{{ $type }}">
|
188
|
+
|
189
|
+
<input type="hidden" name="body" class="form-control" id="InputBody" value="{{ $body }}">
|
190
|
+
|
191
|
+
{{ csrf_field() }}
|
192
|
+
|
193
|
+
<button type="submit" name="action" class="btn btn-primary" value="back">戻る</button>
|
194
|
+
|
195
|
+
<button type="submit" name="action" class="btn btn-primary" value="sent">送信</button>
|
196
|
+
|
197
|
+
</form>
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
@endsection
|
204
|
+
|
205
|
+
```
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
送信完了画面
|
210
|
+
|
211
|
+
```
|
212
|
+
|
213
|
+
@extends('layouts.app')
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
@section('content')
|
218
|
+
|
219
|
+
<div class="container">
|
220
|
+
|
221
|
+
<div class="row">
|
222
|
+
|
223
|
+
<h1>お問い合わせ送信完了</h1>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div class="row">
|
228
|
+
|
229
|
+
<p>お問い合わせありがとうございました。</p>
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="row">
|
234
|
+
|
235
|
+
<p>ご入力いただいた内容は正しく送信されました。</p>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
@endsection
|
242
|
+
|
243
|
+
```
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
web.php
|
248
|
+
|
249
|
+
```
|
250
|
+
|
251
|
+
//お問い合わせページ
|
252
|
+
|
253
|
+
//入力画面
|
254
|
+
|
255
|
+
Route::get('contact','ArticlesController@contact')->name('articles.contact');
|
256
|
+
|
257
|
+
//確認画面
|
258
|
+
|
259
|
+
Route::post('contact/confirm','ArticlesController@confirm')->name('articles.confirm');
|
260
|
+
|
261
|
+
//送信終了 ページ
|
262
|
+
|
263
|
+
Route::post('contact/complete', 'ArticlesController@complete')->name('articles.complete');
|
264
|
+
|
265
|
+
```
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
Controller.php
|
270
|
+
|
271
|
+
```
|
272
|
+
|
273
|
+
public function contact()
|
274
|
+
|
275
|
+
{
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
return view('contacts.contact');
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
}
|
284
|
+
|
105
285
|
|
106
286
|
|
107
|
-
<button type="submit" name="action" class="btn btn-primary" value="sent">送信する</button>
|
108
|
-
|
109
|
-
</form>
|
110
|
-
|
111
|
-
</div>
|
112
|
-
|
113
|
-
</div>
|
114
|
-
|
115
|
-
@endsection
|
116
|
-
|
117
|
-
```
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
確認画面
|
122
|
-
|
123
|
-
```
|
124
|
-
|
125
|
-
@extends('layouts.app')
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
@section('content')
|
130
|
-
|
131
|
-
<div class="container">
|
132
|
-
|
133
|
-
<div class="row">
|
134
|
-
|
135
|
-
<h1>お問い合わせ内容の確認</h1>
|
136
|
-
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div class="row">
|
140
|
-
|
141
|
-
<p>下記、お問い合わせ内容にて送信します。よろしければ「送信」ボタンを押して下さい。</p>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<table class="table table-bordered">
|
146
|
-
|
147
|
-
<tr>
|
148
|
-
|
149
|
-
<td class="table-secondary" style="width:20%">名前</td>
|
150
|
-
|
151
|
-
<td>{{ $name }}</td>
|
152
|
-
|
153
|
-
</tr>
|
154
|
-
|
155
|
-
<tr>
|
156
|
-
|
157
|
-
<td class="table-secondary" style="width:20%">メールアドレス</td>
|
158
|
-
|
159
|
-
<td>{{ $email }}</td>
|
160
|
-
|
161
|
-
</tr>
|
162
|
-
|
163
|
-
<tr>
|
164
|
-
|
165
|
-
<td class="table-secondary">件名</td>
|
166
|
-
|
167
|
-
<td>{{ $type }}</td>
|
168
|
-
|
169
|
-
</tr>
|
170
|
-
|
171
|
-
<tr>
|
172
|
-
|
173
|
-
<td class="table-secondary">メッセージ</td>
|
174
|
-
|
175
|
-
<td>{!! nl2br(e(body)) !!}</td>
|
176
|
-
|
177
|
-
</tr>
|
178
|
-
|
179
|
-
</table>
|
180
|
-
|
181
|
-
<form action="sent" method="post">
|
182
|
-
|
183
|
-
<input type="hidden" name="name" class="form-control" id="InputName" value="{{ $name }}">
|
184
|
-
|
185
|
-
<input type="hidden" name="email" class="form-control" id="InputEmail" value="{{ $email }}">
|
186
|
-
|
187
|
-
<input type="hidden" name="type" class="form-control" id="InputType" value="{{ $type }}">
|
188
|
-
|
189
|
-
<input type="hidden" name="body" class="form-control" id="InputBody" value="{{ $body }}">
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
<button type="submit" name="action" class="btn btn-primary" value="back">戻る</button>
|
194
|
-
|
195
|
-
<button type="submit" name="action" class="btn btn-primary" value="sent">送信</button>
|
196
|
-
|
197
|
-
</form>
|
198
|
-
|
199
|
-
</div>
|
200
|
-
|
201
|
-
</div>
|
202
|
-
|
203
|
-
@endsection
|
204
|
-
|
205
|
-
```
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
送信完了画面
|
210
|
-
|
211
|
-
```
|
212
|
-
|
213
|
-
@extends('layouts.app')
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
@section('content')
|
218
|
-
|
219
|
-
<div class="container">
|
220
|
-
|
221
|
-
<div class="row">
|
222
|
-
|
223
|
-
<h1>お問い合わせ送信完了</h1>
|
224
|
-
|
225
|
-
</div>
|
226
|
-
|
227
|
-
<div class="row">
|
228
|
-
|
229
|
-
<p>お問い合わせありがとうございました。</p>
|
230
|
-
|
231
|
-
</div>
|
232
|
-
|
233
|
-
<div class="row">
|
234
|
-
|
235
|
-
<p>ご入力いただいた内容は正しく送信されました。</p>
|
236
|
-
|
237
|
-
</div>
|
238
|
-
|
239
|
-
</div>
|
240
|
-
|
241
|
-
@endsection
|
242
|
-
|
243
|
-
```
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
web.php
|
248
|
-
|
249
|
-
```
|
250
|
-
|
251
|
-
//お問い合わせページ
|
252
|
-
|
253
|
-
//入力画面
|
254
|
-
|
255
|
-
Route::get('contact','ArticlesController@contact')->name('articles.contact');
|
256
|
-
|
257
|
-
//確認画面
|
258
|
-
|
259
|
-
Route::post('contact/confirm','ArticlesController@confirm')->name('articles.confirm');
|
260
|
-
|
261
|
-
//送信終了 ページ
|
262
|
-
|
263
|
-
Route::post('contact/complete', 'ArticlesController@complete')->name('articles.complete');
|
264
|
-
|
265
|
-
```
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
Controller.php
|
270
|
-
|
271
|
-
```
|
272
|
-
|
273
|
-
public function contact
|
287
|
+
public function confirm(ContactRequest $request)
|
274
288
|
|
275
289
|
{
|
276
290
|
|
291
|
+
//誰でも送ることが可能
|
292
|
+
|
293
|
+
$contact = $request->all();
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
$request->session()->regenerateToken();
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
return view('contact.confirm',$contact);
|
302
|
+
|
303
|
+
}
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
public function complete(ContactRequest $request)
|
308
|
+
|
309
|
+
{
|
310
|
+
|
311
|
+
$contact = $request->all();
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
if ($request->action === '戻る') {
|
316
|
+
|
317
|
+
return redirect()->route('contact')->withInput($contact);
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
$request->session()->regenerateToken();
|
322
|
+
|
277
323
|
|
278
324
|
|
325
|
+
Mail::to('自分のメールアドレス')->send(new Contact($contact));
|
326
|
+
|
327
|
+
|
328
|
+
|
279
|
-
return view('contact
|
329
|
+
return view('contact.complete');
|
330
|
+
|
331
|
+
|
332
|
+
|
280
|
-
|
333
|
+
// データを保存
|
334
|
+
|
281
|
-
|
335
|
+
Article::create($request->all());
|
336
|
+
|
337
|
+
|
282
338
|
|
283
339
|
}
|
284
340
|
|
285
|
-
|
286
|
-
|
287
|
-
public function confirm(ContactRequest $request)
|
288
|
-
|
289
|
-
{
|
290
|
-
|
291
|
-
//誰でも送ることが可能
|
292
|
-
|
293
|
-
$contact = $request->all();
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
$request->session()->regenerateToken();
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
return view('contact.confirm',$contact);
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
public function complete(ContactRequest $request)
|
308
|
-
|
309
|
-
{
|
310
|
-
|
311
|
-
$contact = $request->all();
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
if ($request->action === '戻る') {
|
316
|
-
|
317
|
-
return redirect()->route('contact')->withInput($contact);
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
$request->session()->regenerateToken();
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
Mail::to('自分のメールアドレス')->send(new Contact($contact));
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
return view('contact.complete');
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
// データを保存
|
334
|
-
|
335
|
-
Article::create($request->all());
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
}
|
340
|
-
|
341
341
|
}
|
342
342
|
|
343
343
|
}
|
1
タイトル、内容少し変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
お問い合わせフォームを
|
1
|
+
お問い合わせフォームを実装中、Class App\Http\Controllers\ContactRequest does not exist のエラーが出てしまう。
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
お問い合わせフォームを作成しております。
|
2
2
|
|
3
|
-
フォームに入力後次のページ
|
3
|
+
フォームに入力後次の確認ページに行くときに
|
4
|
+
|
5
|
+
Class App\Http\Controllers\ContactRequest does not existのエラーが出ます。
|
4
6
|
|
5
7
|
|
6
8
|
|
@@ -341,3 +343,19 @@
|
|
341
343
|
}
|
342
344
|
|
343
345
|
```
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
試したこと
|
350
|
+
|
351
|
+
Controller.phpに
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
use App\Http\Controllers\ContactRequest;
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
```
|
360
|
+
|
361
|
+
を追記した。けど解消れなかった。
|