IndexGroupShareRequest.php 725 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `GET /v3/groups/{group}/shares` 的入参:团队文档列表。
  6. */
  7. class IndexGroupShareRequest extends FormRequest
  8. {
  9. /**
  10. * 登录与权限在中间件 / Service 里判:authorize() 返回 false 会渲染成 403,
  11. * 而「没登录」应该是 401、「不是成员」要带具体文案。
  12. */
  13. public function authorize(): bool
  14. {
  15. return true;
  16. }
  17. /**
  18. * @return array<string, array<int, mixed>>
  19. */
  20. public function rules(): array
  21. {
  22. return [
  23. 'page' => ['integer', 'min:1'],
  24. 'per_page' => ['integer', 'min:1', 'max:200'],
  25. ];
  26. }
  27. }