回答編集履歴
2
追記
answer
CHANGED
@@ -39,7 +39,7 @@
|
|
39
39
|
```
|
40
40
|
|
41
41
|
コントローラーに書いていたバリデーションを FormRequest にまとめて記述する。
|
42
|
-
分散しちゃうとメンテ
|
42
|
+
分散しちゃうとメンテナンス性を損ねるし、それぞれが独立してエラーを出してしまいます。
|
43
43
|
|
44
44
|
```php
|
45
45
|
<?php
|
1
修正
answer
CHANGED
@@ -70,7 +70,7 @@
|
|
70
70
|
return [
|
71
71
|
'seed' => 'required',
|
72
72
|
'pref' => 'required',
|
73
|
-
'image' => 'nullable|file|image|
|
73
|
+
'image' => 'nullable|file|image|mimes:jpg,jpeg,png',
|
74
74
|
'body' => 'nullable',
|
75
75
|
];
|
76
76
|
}
|