|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
use App\ValueObjects\Cpf;
|
|
use App\ValueObjects\Cpf;
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
+use Illuminate\Validation\Rule;
|
|
|
|
|
|
|
|
class StudentRegistrationDraftRequest extends FormRequest
|
|
class StudentRegistrationDraftRequest extends FormRequest
|
|
|
{
|
|
{
|
|
@@ -24,9 +25,9 @@ public function rules(): array
|
|
|
'registration_draft_token' => 'sometimes|nullable|uuid',
|
|
'registration_draft_token' => 'sometimes|nullable|uuid',
|
|
|
'name' => 'required|string|max:255',
|
|
'name' => 'required|string|max:255',
|
|
|
'birth_date' => 'required|date',
|
|
'birth_date' => 'required|date',
|
|
|
- 'document_number' => ['sometimes', 'nullable', 'string', 'max:20', Cpf::rule(), 'unique:students,document_number'],
|
|
|
|
|
|
|
+ 'document_number' => ['sometimes', 'nullable', 'string', 'max:20', Cpf::rule(), Rule::unique('students', 'document_number')->withoutTrashed()],
|
|
|
'gender' => 'sometimes|nullable|string|in:no_preference,male,female,other',
|
|
'gender' => 'sometimes|nullable|string|in:no_preference,male,female,other',
|
|
|
- 'email' => 'sometimes|nullable|email|unique:students,email',
|
|
|
|
|
|
|
+ 'email' => ['sometimes', 'nullable', 'email', Rule::unique('students', 'email')->withoutTrashed()],
|
|
|
'phone' => 'sometimes|nullable|string|max:20',
|
|
'phone' => 'sometimes|nullable|string|max:20',
|
|
|
'postal_code' => 'sometimes|nullable|string|max:10',
|
|
'postal_code' => 'sometimes|nullable|string|max:10',
|
|
|
'street' => 'sometimes|nullable|string|max:255',
|
|
'street' => 'sometimes|nullable|string|max:255',
|