| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Http\Requests\V3;
- use Illuminate\Foundation\Http\FormRequest;
- /**
- * `GET /v3/groups` 的入参:按名字搜公开团队。
- */
- class IndexGroupRequest extends FormRequest
- {
- /**
- * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
- * 而「没登录」应该是 401、「不是成员」要带具体文案。
- */
- public function authorize(): bool
- {
- return true;
- }
- /**
- * @return array<string, array<int, mixed>>
- */
- public function rules(): array
- {
- return [
- 'search' => ['sometimes', 'nullable', 'string', 'max:64'],
- 'page' => ['integer', 'min:1'],
- 'per_page' => ['integer', 'min:1', 'max:200'],
- ];
- }
- }
|