123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Http\Requests\Client\Wechat;
- use Illuminate\Foundation\Http\FormRequest;
- class GetAuthUrlRequest 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, array<int, string>>
- */
- public function rules(): array
- {
- return [
- 'redirect_uri' => ['required', 'url'],
- 'scope' => ['nullable', 'string', 'in:snsapi_base,snsapi_userinfo'],
- ];
- }
- /**
- * Get custom attributes for validator errors.
- *
- * @return array<string, string>
- */
- public function attributes(): array
- {
- return [
- 'redirect_uri' => '回调地址',
- 'scope' => '授权范围',
- ];
- }
- }
|