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

質問編集履歴

4

細く

2019/06/08 10:50

投稿

zushi0905
zushi0905

スコア683

title CHANGED
File without changes
body CHANGED
@@ -53,4 +53,7 @@
53
53
  </select>
54
54
  ```
55
55
 
56
- よろしくお願い致します。
56
+ よろしくお願い致します。
57
+
58
+ ### 補足
59
+ between1,9 でバリデーション かけた時、12でも通ってしまっています。

3

2019/06/08 10:50

投稿

zushi0905
zushi0905

スコア683

title CHANGED
File without changes
body CHANGED
@@ -19,7 +19,12 @@
19
19
 
20
20
  FormRequest
21
21
  ```php
22
+ public function rules()
23
+ {
24
+ return [
22
- "quantity" => 'numeric | between:1,12 | required',
25
+ "quantity" => 'numeric | between:1,12 | required',
26
+ ];
27
+ }
23
28
  ```
24
29
 
25
30
  Contoroller

2

a

2019/06/08 10:21

投稿

zushi0905
zushi0905

スコア683

title CHANGED
File without changes
body CHANGED
@@ -17,19 +17,21 @@
17
17
  The quantity must be between 1 and 12 .
18
18
 
19
19
 
20
-
21
- ```FormRequest
20
+ FormRequest
21
+ ```php
22
22
  "quantity" => 'numeric | between:1,12 | required',
23
23
  ```
24
24
 
25
- ```Contoroller
25
+ Contoroller
26
+ ```php
26
27
  public function add(CartFormRequest $req){
27
28
  $this->cartService->add_cart($req);
28
29
  return view('cart.add');
29
30
  }
30
31
  ```
31
32
 
32
- ```blade
33
+ blade
34
+ ```php
33
35
  <select name="quantity">
34
36
  <option value="1">1</option>
35
37
  <option value="2">2</option>

1

修正

2019/06/08 10:15

投稿

zushi0905
zushi0905

スコア683

title CHANGED
File without changes
body CHANGED
@@ -1,7 +1,7 @@
1
1
  バリデーションルールが思う通りに動いてくれない。
2
2
 
3
3
  ### 環境
4
- - PHP 7
4
+ - PHP 7.2
5
5
  - Laravel 5.3
6
6
 
7
7