1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Http\Requests\Coach\Auth;
- use Illuminate\Foundation\Http\FormRequest;
- class QualAuthRequest extends FormRequest
- {
- public function authorize(): bool
- {
- return true;
- }
- public function rules(): array
- {
- return [
- 'qual_type' => 'required|string|max:255',
- 'qual_no' => 'nullable|string|max:255',
- 'qual_photo' => 'required|string|max:255',
- 'valid_start' => 'nullable|date',
- 'valid_end' => 'nullable|date|after_or_equal:valid_start'
- ];
- }
- public function messages(): array
- {
- return [
- 'qual_type.required' => '资质类型不能为空',
- 'qual_type.max' => '资质类型不能超过255个字符',
- 'qual_no.max' => '资质证书编号不能超过255个字符',
- 'qual_photo.required' => '资质证书照片不能为空',
- 'qual_photo.max' => '资质证书照片地址不能超过255个字符',
- 'valid_start.date' => '有效期开始日期格式不正确',
- 'valid_end.date' => '有效期结束日期格式不正确',
- 'valid_end.after_or_equal' => '有效期结束日期必须大于或等于开始日期'
- ];
- }
- }
|