2
0

IndexPaliWordSuggestionRequest.php 551 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `GET /v3/pali-word-suggestions`:巴利词的前缀补全。
  6. */
  7. class IndexPaliWordSuggestionRequest extends FormRequest
  8. {
  9. public function authorize(): bool
  10. {
  11. return true;
  12. }
  13. /**
  14. * @return array<string, array<int, mixed>>
  15. */
  16. public function rules(): array
  17. {
  18. return [
  19. 'q' => ['required', 'string', 'max:64'],
  20. 'limit' => ['sometimes', 'integer', 'min:1', 'max:50'],
  21. ];
  22. }
  23. }