1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Http\Requests\Admin\Wallet;
- use Illuminate\Foundation\Http\FormRequest;
- use App\Enums\WithdrawAuditStatus;
- class WithdrawAuditRequest extends FormRequest
- {
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules(): array
- {
- return [
- 'status' => ['required', 'integer', 'in:' . implode(',', [
- WithdrawAuditStatus::APPROVED->value,
- WithdrawAuditStatus::REJECTED->value,
- ])],
- 'remark' => ['nullable', 'string', 'max:255'],
- ];
- }
- /**
- * Get custom messages for validator errors.
- *
- * @return array
- */
- public function messages(): array
- {
- return [
- 'status.required' => '请选择审核状态',
- 'status.integer' => '审核状态格式错误',
- 'status.in' => '审核状态无效',
- 'remark.string' => '审核备注必须是字符串',
- 'remark.max' => '审核备注不能超过255个字符',
- ];
- }
- }
|