123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Http\Requests\API\User;
- use Illuminate\Foundation\Http\FormRequest;
- class ResetPasswordRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- */
- public function authorize(): bool
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
- */
- public function rules(): array
- {
- return [
- 'username' => 'required',
- 'code' => 'required',
- 'new_password' => 'required|min:6|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,}$/',// 至少6位,包含大小写字母和数字,At least 6 digits, including upper and lower case letters and numbers
- ];
- }
- }
|