class CopyAddRequest extends FormRequest (View source)

Form request responsible for validating data when adding copies to a book.

This request ensures that the number of copies (amount) is a valid positive integer.

Methods

bool
authorize()

Determine if the user is authorized to make this request.

array
rules()

Get the validation rules that apply to the request.

array
messages()

Get the custom messages for validation errors.

void
prepareForValidation()

Prepare the data for validation by sanitizing and normalizing inputs.

string
input(string $key, mixed $default)

No description

void
merge(array $input)

No description

Details

bool authorize()

Determine if the user is authorized to make this request.

Return Value

bool

true if the user is authorized to perform this request

array rules()

Get the validation rules that apply to the request.

Return Value

array

validation rules for the incoming request data

array messages()

Get the custom messages for validation errors.

Return Value

array

custom messages for each validation rule

protected void prepareForValidation()

Prepare the data for validation by sanitizing and normalizing inputs.

This method trims string values and casts numeric inputs to the appropriate type before the validation rules are applied.

Return Value

void

string input(string $key, mixed $default)

No description

Parameters

string $key
mixed $default

Return Value

string

void merge(array $input)

No description

Parameters

array $input

Return Value

void