class UserStoreRequest extends FormRequest (View source)

Handles validation logic for creating a new user.

This request ensures that the provided name, email, and password comply with structural, uniqueness, and formatting rules before being persisted to the database.

Methods

bool
authorize()

Determine if the user is authorized to make this request.

array
rules()

Define validation rules for the user creation request.

array
messages()

Custom error messages for validation failures.

void
prepareForValidation()

Prepare input data before applying validation rules.

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 the request is authorized

array rules()

Define validation rules for the user creation request.

Return Value

array

validation rules for user input fields

array messages()

Custom error messages for validation failures.

Return Value

array

the validation messages mapped to rules

protected void prepareForValidation()

Prepare input data before applying validation rules.

This method trims text fields and ensures consistent formatting for email and password inputs to prevent false negatives during validation.

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