class StudentStoreRequest extends FormRequest (View source)

Handles validation for storing a new student record.

Performs:

  • Field sanitization and normalization before validation.
  • Custom validation for CPF, email, and phone uniqueness (using hashed values).
  • Validation of structured fields like course, term, and period.

Methods

bool
authorize()

Determine if the user is authorized to make this request.

array
rules()

Define validation rules for creating a student.

array
messages()

Get custom error messages for failed validation rules.

void
prepareForValidation()

Prepare and sanitize input data before validation.

mixed
input(string $key, mixed $default = null)

Retrieve an input item from the request.

void
merge(array $input)

Merge new input into the request's data.

Details

bool authorize()

Determine if the user is authorized to make this request.

Return Value

bool

true if authorized

array rules()

Define validation rules for creating a student.

Return Value

array

validation rules

array messages()

Get custom error messages for failed validation rules.

Return Value

array

custom error messages

protected void prepareForValidation()

Prepare and sanitize input data before validation.

Removes non-numeric characters from CPF, phone, and period fields, trims whitespace from text fields, and normalizes input casing.

Return Value

void

mixed input(string $key, mixed $default = null)

Retrieve an input item from the request.

Parameters

string $key
mixed $default

Return Value

mixed

void merge(array $input)

Merge new input into the request's data.

Parameters

array $input

Return Value

void