ImportTermsRequest.php 519 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * 术语导入:上传一个 xlsx(multipart/form-data 的 `file`),不超过 5MB。
  6. */
  7. class ImportTermsRequest 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. 'file' => ['required', 'file', 'extensions:xlsx', 'max:5120'],
  20. ];
  21. }
  22. }