FormRequest
Extends
Implements
Uses
Properties
$redirect string
The URI to redirect to if validation fails.
$redirectRoute string
The route to redirect to if validation fails.
$redirectAction string
The controller action to redirect to if validation fails.
$errorBag string
The key to be used for the view error bag.
$stopOnFirstFailure bool
Indicates whether validation should stop after the first rule failure.
Methods
createDefaultValidator ( Factory $factory ) : Validator
Create the default validator instance.
Parameters
- $factory Factory
validationData ( ) : array
Get data to be validated from the request.
failedValidation ( Validator $validator ) : void
Handle a failed validation attempt.
Parameters
- $validator Validator
getRedirectUrl ( ) : string
Get the URL to redirect to on a validation error.
passesAuthorization ( ) : bool
Determine if the request passes the authorization check.
failedAuthorization ( ) : void
Handle a failed authorization attempt.
safe ( array $keys ) : ValidatedInput |array
Get a validated input container for the validated input.
Parameters
- $keys array|null
validated ( $key , $default ) : mixed
Get the validated data from the request.
Parameters
- $key array|int|string|null
- $default mixed
messages ( ) : array
Get custom messages for validator errors.
attributes ( ) : array
Get custom attributes for validator errors.
setValidator ( Validator $validator ) : $this
Set the Validator instance.
Parameters
- $validator Validator
setRedirector ( Redirector $redirector ) : $this
Set the Redirector instance.
Parameters
- $redirector Redirector