AssociateValidationRequest.php 739 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Requests;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. class AssociateValidationRequest extends FormRequest
  5. {
  6. public function authorize(): bool
  7. {
  8. return true;
  9. }
  10. public function rules(): array
  11. {
  12. return [
  13. 'cpf' => [
  14. 'nullable',
  15. 'string',
  16. 'required_without_all:name,registration',
  17. ],
  18. 'name' => [
  19. 'nullable',
  20. 'string',
  21. 'required_without_all:cpf,registration',
  22. ],
  23. 'registration' => [
  24. 'nullable',
  25. 'string',
  26. 'required_without_all:cpf,name',
  27. ],
  28. ];
  29. }
  30. }