class Illuminate / Foundation / Http / FormRequest

FormRequest

Extends

Implements

Uses

Properties

protected

$container Container

The container instance.

Default: null
protected

$redirector Redirector

The redirector instance.

Default: null
protected

$redirect string

The URI to redirect to if validation fails.

Default: null
protected

$redirectRoute string

The route to redirect to if validation fails.

Default: null
protected

$redirectAction string

The controller action to redirect to if validation fails.

Default: null
protected

$errorBag string

The key to be used for the view error bag.

Default: 'default'
protected

$stopOnFirstFailure bool

Indicates whether validation should stop after the first rule failure.

Default: false
protected

$validator Validator

The validator instance.

Default: null

Methods

protected

getValidatorInstance ( ) : Validator

Get the validator instance for the request.

protected

createDefaultValidator ( Factory $factory ) : Validator

Create the default validator instance.

Parameters

public

validationData ( ) : array

Get data to be validated from the request.

protected

failedValidation ( Validator $validator ) : void

Handle a failed validation attempt.

Parameters

protected

getRedirectUrl ( ) : string

Get the URL to redirect to on a validation error.

protected

passesAuthorization ( ) : bool

Determine if the request passes the authorization check.

protected

failedAuthorization ( ) : void

Handle a failed authorization attempt.

public

safe ( array $keys ) : ValidatedInput |array

Get a validated input container for the validated input.

Parameters

  • $keys array|null
public

validated ( $key , $default ) : mixed

Get the validated data from the request.

Parameters

  • $key array|int|string|null
  • $default mixed
public

messages ( ) : array

Get custom messages for validator errors.

public

attributes ( ) : array

Get custom attributes for validator errors.

public

setValidator ( Validator $validator ) : $this

Set the Validator instance.

Parameters

public

setRedirector ( Redirector $redirector ) : $this

Set the Redirector instance.

Parameters

public

setContainer ( Container $container ) : $this

Set the container implementation.

Parameters