12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Http\Requests\Coach;
- use Illuminate\Foundation\Http\FormRequest;
- class SubmitRealNameRequest extends FormRequest
- {
- public function authorize()
- {
- return true;
- }
- public function rules()
- {
- return [
- 'real_name' => 'nullable|string|min:2|max:20',
- 'id_card' => 'nullable|string|size:18',
- 'id_card_front_photo' => 'required|string|max:2048',
- 'id_card_back_photo' => 'required|string|max:2048',
- 'id_card_hand_photo' => 'required|string|max:2048',
- ];
- }
- public function messages()
- {
- return [
- 'real_name.string' => '姓名必须是字符串',
- 'real_name.min' => '姓名不能少于2个字符',
- 'real_name.max' => '姓名不能超过20个字符',
- 'id_card.size' => '身份证号必须是18位',
- 'id_card_front_photo.required' => '身份证正面照片不能为空',
- 'id_card_front_photo.max' => '身份证正面照片数据过大',
- 'id_card_back_photo.required' => '身份证反面照片不能为空',
- 'id_card_back_photo.max' => '身份证反面照片数据过大',
- 'id_card_hand_photo.required' => '手持身份证照片不能为空',
- 'id_card_hand_photo.max' => '手持身份证照片数据过大',
- ];
- }
- }
|