|
1 | 1 | <?php |
2 | 2 |
|
3 | | -namespace App\Http\Requests\ResourceEdit; |
| 3 | +namespace App\Http\Requests; |
4 | 4 |
|
5 | 5 | use Illuminate\Foundation\Http\FormRequest; |
6 | 6 | use Illuminate\Support\Facades\Auth; |
@@ -35,13 +35,13 @@ public function rules(): array |
35 | 35 | 'proposed_changes.page_url' => ['nullable', 'string', 'url:http,https', 'max:255'], |
36 | 36 | 'proposed_changes.difficulty' => ['nullable', 'string', Rule::in(config('computerScienceResource.difficulties'))], |
37 | 37 | 'proposed_changes.pricing' => ['nullable', 'string', Rule::in(config('computerScienceResource.pricings'))], |
38 | | - 'proposed_changes.topic_tags' => ['nullable', 'array', 'min:2'], |
39 | | - 'proposed_changes.topic_tags.*' => ['required', 'distinct', 'string', 'max:50'], |
40 | 38 | 'proposed_changes.image_file' => ['nullable', 'image', 'max:500'], // 500 kilobytes |
| 39 | + 'proposed_changes.topic_tags' => ['nullable', 'array', 'min:2'], |
| 40 | + 'proposed_changes.topic_tags.*' => ['required', 'distinct', 'string', 'max:50', 'regex:'.config('computerScienceResource.tags_regex')], |
41 | 41 | 'proposed_changes.general_tags' => ['nullable', 'array'], |
42 | | - 'proposed_changes.general_tags.*' => ['required', 'distinct', 'string', 'max:50'], |
| 42 | + 'proposed_changes.general_tags.*' => ['required', 'distinct', 'string', 'max:50', 'regex:'.config('computerScienceResource.tags_regex')], |
43 | 43 | 'proposed_changes.programming_language_tags' => ['nullable', 'array'], |
44 | | - 'proposed_changes.programming_language_tags.*' => ['required', 'distinct', 'string', 'max:50'], |
| 44 | + 'proposed_changes.programming_language_tags.*' => ['required', 'distinct', 'string', 'max:50', 'regex:'.config('computerScienceResource.tags_regex')], |
45 | 45 | ]; |
46 | 46 | } |
47 | 47 | } |
0 commit comments