FormRequest
- Full name:
\Codefy\Framework\Http\Request\FormRequest - Parent class:
ServerRequest - This class implements:
\Codefy\Framework\Validation\DataValidator - This class is an Abstract class
Properties
data
The filtered input data.
container
redirectUri
The URI to redirect to if validation fails.
validator
The validator instance.
Methods
all
Return all input data as an array.
only
Replace internal data with only the specified keys.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$keys | array |
except
Replace internal data excluding the specified keys.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$keys | array |
validated
Validate the request data and return validated data.
value
Return validated or filtered value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed | |
$default | mixed |
messages
Get custom messages for validator errors.
makeValidator
Get the validator instance for the request.
Throws:
createDefaultValidator
Create the default validator instance.
protected createDefaultValidator(\Qubus\Validation\Factories\ValidationFactory $factory): \Qubus\Validation\Validation
Parameters:
| Parameter | Type | Description |
|---|---|---|
$factory | \Qubus\Validation\Factories\ValidationFactory |
Throws:
setValidator
Set the Validator instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$validator | \Qubus\Validation\Validation |
setContainer
Set the container implementation.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$container | \Qubus\Injector\ServiceContainer |
errors
Return validation errors.
validationRules
Get the validation rules for this form request.
Inherited methods
validateResolved
Validate the class instance.
Throws:
prepareForValidation
Prepare the data for validation.
getValidatorInstance
Get the validator instance for the request.
Throws:
passedValidation
Handle a passed validation attempt.
passesAuthorization
Determine if the request passes the authorization check.
failedValidation
Handle a failed validation attempt.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$message | ?string | |
$code | int |
Throws:
failedAuthorization
Throws: