HandleCallbackRequest.php 927 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Http\Requests\Client\Wechat;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class HandleCallbackRequest extends FormRequest
  5. {
  6. /**
  7. * Determine if the user is authorized to make this request.
  8. */
  9. public function authorize(): bool
  10. {
  11. return true;
  12. }
  13. /**
  14. * Get the validation rules that apply to the request.
  15. *
  16. * @return array<string, array<int, string>>
  17. */
  18. public function rules(): array
  19. {
  20. return [
  21. 'code' => ['required', 'string'],
  22. 'state' => ['required', 'string', 'size:32'],
  23. 'invite_code' => ['nullable', 'string'],
  24. ];
  25. }
  26. /**
  27. * Get custom attributes for validator errors.
  28. *
  29. * @return array<string, string>
  30. */
  31. public function attributes(): array
  32. {
  33. return [
  34. 'code' => '授权码',
  35. 'state' => '状态码',
  36. ];
  37. }
  38. }