StudentRegistrationDraftRequest.php 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Http\Requests;
  3. use App\ValueObjects\Cpf;
  4. use Illuminate\Foundation\Http\FormRequest;
  5. class StudentRegistrationDraftRequest extends FormRequest
  6. {
  7. public function rules(): array
  8. {
  9. return [
  10. 'registration_draft_token' => 'sometimes|nullable|uuid',
  11. 'name' => 'required|string|max:255',
  12. 'birth_date' => 'required|date',
  13. 'document_number' => ['sometimes', 'nullable', 'string', 'max:20', Cpf::rule()],
  14. 'gender' => 'sometimes|nullable|string|in:no_preference,male,female,other',
  15. 'email' => 'sometimes|nullable|email|unique:students,email',
  16. 'phone' => 'sometimes|nullable|string|max:20',
  17. 'postal_code' => 'sometimes|nullable|string|max:10',
  18. 'street' => 'sometimes|nullable|string|max:255',
  19. 'address_number' => 'sometimes|nullable|string|max:20',
  20. 'neighborhood' => 'sometimes|nullable|string|max:255',
  21. 'city_id' => 'sometimes|nullable|integer|exists:cities,id',
  22. 'state_id' => 'sometimes|nullable|integer|exists:states,id',
  23. 'complement' => 'sometimes|nullable|string|max:255',
  24. 'payer_name' => 'sometimes|nullable|string|max:255',
  25. 'how_did_you_know_us' => 'sometimes|nullable|string|in:referral,social_media,google,other',
  26. 'notes' => 'sometimes|nullable|string',
  27. ];
  28. }
  29. }