IndexTipitakaChapterChannelRequest.php 745 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `GET /v3/tipitaka-chapter-channels/{book}/{para}` 的入参。
  6. *
  7. * book / para 在路径上(路由约束保证是数字),这里只有分页。
  8. */
  9. class IndexTipitakaChapterChannelRequest extends FormRequest
  10. {
  11. /**
  12. * 公开的只读接口;可见性在 Service 里按登录用户判。
  13. */
  14. public function authorize(): bool
  15. {
  16. return true;
  17. }
  18. /**
  19. * @return array<string, array<int, mixed>>
  20. */
  21. public function rules(): array
  22. {
  23. return [
  24. 'page' => ['sometimes', 'integer', 'min:1'],
  25. 'per_page' => ['sometimes', 'integer', 'min:1', 'max:200'],
  26. ];
  27. }
  28. }