| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Http\Requests\V3;
- use Illuminate\Foundation\Http\FormRequest;
- /**
- * `GET /v3/me/groups` 的入参:我加入的团队。结果集由登录态决定,不接受指定用户。
- */
- class IndexMeGroupRequest extends FormRequest
- {
- /**
- * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
- * 而「没登录」应该是 401、「不是成员」要带具体文案。
- */
- public function authorize(): bool
- {
- return true;
- }
- /**
- * @return array<string, array<int, mixed>>
- */
- public function rules(): array
- {
- return [
- 'owned' => ['sometimes', 'in:true,false,1,0'],
- 'search' => ['sometimes', 'nullable', 'string', 'max:64'],
- 'page' => ['integer', 'min:1'],
- 'per_page' => ['integer', 'min:1', 'max:200'],
- ];
- }
- }
|