質問編集履歴
5
変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
### web.php
|
9
9
|
```
|
10
|
-
Route::post('/post', 'Controller@discrimination')->name('post
|
10
|
+
Route::post('/post', 'Controller@discrimination')->name('post');
|
11
11
|
```
|
4
変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
### web.php
|
9
9
|
```
|
10
|
-
Route::post('/
|
10
|
+
Route::post('/post', 'Controller@discrimination')->name('post.diagnose');
|
11
11
|
```
|
3
コード変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
### web.php
|
9
9
|
```
|
10
|
-
Route::post('/skin/post', '
|
10
|
+
Route::post('/skin/post', 'Controller@discrimination')->name('post.diagnose');
|
11
11
|
```
|
2
不要な部分の消去
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
laravel
|
1
|
+
laravel はいいいえを使った質問
|
body
CHANGED
@@ -8,30 +8,4 @@
|
|
8
8
|
### web.php
|
9
9
|
```
|
10
10
|
Route::post('/skin/post', 'SkindiagnoseController@discrimination')->name('post.diagnose');
|
11
|
-
```
|
11
|
+
```
|
12
|
-
|
13
|
-
### SkindiagnoseController
|
14
|
-
```ここに言語を入力
|
15
|
-
<?php
|
16
|
-
|
17
|
-
namespace App\Http\Controllers;
|
18
|
-
|
19
|
-
use Illuminate\Http\Request;
|
20
|
-
|
21
|
-
class SkindiagnoseController extends Controller
|
22
|
-
{
|
23
|
-
public function index() {
|
24
|
-
return view('blog.skindiagnose');
|
25
|
-
}
|
26
|
-
|
27
|
-
public function discrimination(Request $request) {
|
28
|
-
|
29
|
-
}
|
30
|
-
}
|
31
|
-
```
|
32
|
-
|
33
|
-
コントローラーをどう書いたら良いのかが分からず詰まってしまいました。。
|
34
|
-
初心者のためコードが拙く申し訳ありません。
|
35
|
-
知識不足で申し訳ないのですが、アドバイスを頂けないでしょうか。
|
36
|
-
dd($request->t_zone);で、はいを選択し、診断を押して見ると、1と表示されるので、
|
37
|
-
はいの場合は1が足されていく・・というような感じで作りたいと考えています。
|
1
不要な部分の消去
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,89 +1,10 @@
|
|
1
|
-
|
1
|
+
もう少し自分で考えます。
|
2
|
-
肌タイプの質問を作っていて、はい、いいえの質問に答えて行って頂き、診断を押すと
|
3
|
-
は
|
2
|
+
以下は質問の消去ができないため少しコードを残しているのみなりますので
|
3
|
+
ご覧いただいても何もありません。すいません。
|
4
|
+
申し訳ありませんでした。
|
4
5
|
|
5
|
-
### **skindiagnose.blade.php**
|
6
|
-
```
|
7
6
|
|
8
|
-
<!-- About Section Start -->
|
9
7
|
|
10
|
-
<div id="about-us">
|
11
|
-
<div class="container p-3 mb-2 bg-light text-dark shadow">
|
12
|
-
<h3 class="text-center">★肌診断チェック★</h3>
|
13
|
-
{{-- <div class="row" style="margin-right: 0; margin-left: 0;" data-aos="fade-up" data-aos-delay="300"> --}}
|
14
|
-
<div class="form-group text-center form-input-radio">
|
15
|
-
<form method="post" action="{{ route('post.diagnose') }}">
|
16
|
-
@csrf
|
17
|
-
{{-- <input class="radio-input" type="radio" name="t_zone" id="yes" value="1">
|
18
|
-
<label for="yes">
|
19
|
-
はい
|
20
|
-
</label>
|
21
|
-
</div>
|
22
|
-
<div class="form-input-radio">
|
23
|
-
<input class="radio-input" type="radio" name="t_zone" id="no" value="0">
|
24
|
-
<label for="no">
|
25
|
-
いいえ
|
26
|
-
</label>
|
27
|
-
</div>
|
28
|
-
<div>
|
29
|
-
<i class="fas fa-angle-double-right"></i>
|
30
|
-
<label class="custom-control-label h5 mb-4 mr-3">Tゾーンがベタつく</label>
|
31
|
-
<input class="radio-input mb-4 ml-2" type="radio" name="t_zone" id="yes" value="1">
|
32
|
-
<label for="yes">はい</label>
|
33
|
-
<input class="radio-input mb-4" type="radio" name="t_zone" id="no" value="0">
|
34
|
-
<label for="no">いいえ</label>
|
35
|
-
</div>
|
36
|
-
<div>
|
37
|
-
<i class="fas fa-angle-double-right"></i>
|
38
|
-
<label class="custom-control-label h5 mb-4 mr-5" for="custom-check-2">毛穴が目立つ</label>
|
39
|
-
<input class="radio-input mb-4 ml-4" type="radio" name="keana" id="yes" value="1">
|
40
|
-
<label for="yes">はい</label>
|
41
|
-
<input class="radio-input mb-4" type="radio" name="keana" id="no" value="0">
|
42
|
-
<label for="no">いいえ</label>
|
43
|
-
</div>
|
44
|
-
<div>
|
45
|
-
<i class="fas fa-angle-double-right"></i>
|
46
|
-
<label class="custom-control-label h5 mb-4 mr-2" for="custom-check-3">洗顔後肌がつっぱる</label>
|
47
|
-
<input class="radio-input mb-4 ml-1" type="radio" name="wash" id="yes" value="1">
|
48
|
-
<label for="yes">はい</label>
|
49
|
-
<input class="radio-input mb-4 text-center" type="radio" name="wash" id="no" value="0">
|
50
|
-
<label for="no">いいえ</label>
|
51
|
-
</div>
|
52
|
-
<div>
|
53
|
-
<i class="fas fa-angle-double-right"></i>
|
54
|
-
<label class="custom-control-label h5 mb-4 mr-5" for="custom-check-4">化粧のりが悪い</label>
|
55
|
-
<input class="radio-input mb-4 ml-1" type="radio" name="make" id="yes" value="1">
|
56
|
-
<label for="yes">はい</label>
|
57
|
-
<input class="radio-input mb-4 text-center" type="radio" name="make" id="yes" value="0">
|
58
|
-
<label for="no">いいえ</label>
|
59
|
-
</div>
|
60
|
-
<div>
|
61
|
-
<i class="fas fa-angle-double-right"></i>
|
62
|
-
<label class="custom-control-label h5 mb-4 mr-5" for="custom-check-4">疲れが取れない</label>
|
63
|
-
<input class="radio-input mb-4 ml-1" type="radio" name="tiger" id="yes" value="1">
|
64
|
-
<label for="yes">はい</label>
|
65
|
-
<input class="radio-input mb-4 text-center" type="radio" name="tiger" id="no" value="0">
|
66
|
-
<label for="no">いいえ</label>
|
67
|
-
</div>
|
68
|
-
<div>
|
69
|
-
<i class="fas fa-angle-double-right"></i>
|
70
|
-
<label class="custom-control-label h5 mb-5 mr-3" for="custom-check-6">顔がテカリやすい</label>
|
71
|
-
<input class="radio-input mb-4 ml-3" type="radio" name="shiny" id="yes" value="1">
|
72
|
-
<label for="yes">はい</label>
|
73
|
-
<input class="radio-input mb-4 text-center" type="radio" name="shiny" id="no" value="0">
|
74
|
-
<label for="no">いいえ</label>
|
75
|
-
</div>
|
76
|
-
<input type="submit" class="btn btn-primary mb-4 text-center" value="診断する">
|
77
|
-
</div>
|
78
|
-
</form>
|
79
|
-
</div>
|
80
|
-
</div>
|
81
|
-
<!-- About Section End -->
|
82
|
-
```
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
8
|
### web.php
|
88
9
|
```
|
89
10
|
Route::post('/skin/post', 'SkindiagnoseController@discrimination')->name('post.diagnose');
|
@@ -104,19 +25,7 @@
|
|
104
25
|
}
|
105
26
|
|
106
27
|
public function discrimination(Request $request) {
|
107
|
-
|
28
|
+
|
108
|
-
// $yes1 = ($request->t_zone === 'yes');
|
109
|
-
// $yes2 = ($request->discrimination === 'yes');
|
110
|
-
// $total = $yes1+$yes2;
|
111
|
-
|
112
|
-
// if($total == 1 >= 8) {
|
113
|
-
// return view();
|
114
|
-
// } elseif ($total == 9 >= 12 ) {
|
115
|
-
// return view();
|
116
|
-
// } else{
|
117
|
-
// return view ();
|
118
|
-
// }
|
119
|
-
return redirect();
|
120
29
|
}
|
121
30
|
}
|
122
31
|
```
|