ActionRequest.php 786 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Requests\API\Approval;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. use Illuminate\Validation\Rules\File;
  5. class ActionRequest extends FormRequest
  6. {
  7. /**
  8. * Determine if the user is authorized to make this request.
  9. */
  10. public function authorize(): bool
  11. {
  12. return true;
  13. }
  14. /**
  15. * Get the validation rules that apply to the request.
  16. *
  17. * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
  18. */
  19. public function rules(): array
  20. {
  21. return [
  22. "status" => "required|in:1,2",
  23. "comment" => "max:255",
  24. "signature_file" => [
  25. 'file',
  26. File::types(['pdf'])->max("10mb")
  27. ]
  28. ];
  29. }
  30. }