回答編集履歴
4
追記
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
対応策についてですが、それでOKです。
|
1
|
+
~~対応策についてですが、それでOKです。~~(回答投稿後に質問のコードが変わったのでNGとさせてください。)
|
2
2
|
しかし、フォームで指定するHTTPメソッドはget以外にする必要があります。
|
3
3
|
(HTTPメソッドの正しい使い方・思想についてはここでは触れません)
|
4
4
|
|
3
リダイレクト追加
answer
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
// routes.php
|
7
7
|
Route::get('/input', 'Contact@index');
|
8
8
|
Route::get('/confirm', function () {
|
9
|
-
|
9
|
+
return redirect('/input');
|
10
10
|
});
|
11
11
|
Route::post('/confirm', 'Contact@confirm');
|
12
12
|
Route::get('/thanks', function () {
|
13
|
-
|
13
|
+
return redirect('/input');
|
14
14
|
});
|
15
15
|
Route::post('/thanks', 'Contact@thanks');
|
16
16
|
```
|
2
routes.phpの追記
answer
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
しかし、フォームで指定するHTTPメソッドはget以外にする必要があります。
|
3
3
|
(HTTPメソッドの正しい使い方・思想についてはここでは触れません)
|
4
4
|
|
5
|
+
```php
|
6
|
+
// routes.php
|
7
|
+
Route::get('/input', 'Contact@index');
|
8
|
+
Route::get('/confirm', function () {
|
9
|
+
// アウト
|
10
|
+
});
|
11
|
+
Route::post('/confirm', 'Contact@confirm');
|
12
|
+
Route::get('/thanks', function () {
|
13
|
+
// アウト
|
14
|
+
});
|
15
|
+
Route::post('/thanks', 'Contact@thanks');
|
16
|
+
```
|
17
|
+
|
5
18
|
```html
|
6
19
|
<!-- 入力画面 -->
|
7
20
|
<form action="confirm" method="post">
|
1
コメントアウトミス
answer
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
(HTTPメソッドの正しい使い方・思想についてはここでは触れません)
|
4
4
|
|
5
5
|
```html
|
6
|
-
|
6
|
+
<!-- 入力画面 -->
|
7
7
|
<form action="confirm" method="post">
|
8
8
|
<input type="submit" value="確認">
|
9
9
|
<!-- code -->
|
10
10
|
</form>
|
11
11
|
|
12
|
-
|
12
|
+
<!-- 確認画面 -->
|
13
13
|
<form action="thanks" method="post">
|
14
14
|
<input type="submit" value="送信">
|
15
15
|
<!-- code -->
|