1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Http\Requests\Client\User;
- use Illuminate\Foundation\Http\FormRequest;
- class FeedbackRequest extends FormRequest
- {
- public function authorize(): bool
- {
- return true;
- }
- public function rules(): array
- {
- return [
- 'content' => 'required|string|max:1000',
- 'images' => 'nullable|array',
- 'images.*' => 'string|url|max:255',
- 'contact' => 'nullable|string|max:50',
- ];
- }
- public function messages(): array
- {
- return [
- 'content.required' => '反馈内容不能为空',
- 'content.max' => '反馈内容不能超过1000个字符',
- 'images.*.url' => '图片必须是有效的URL地址',
- ];
- }
- }
|