trait ValidatesRequests (View source)

Methods

array
validateWith(Validator|array $validator, Request|null $request = null)

Run the validation routine against the given validator.

array
validate(Request $request, array $rules, array $messages = [], array $attributes = [])

Validate the given request with the given rules.

array
validateWithBag(string $errorBag, Request $request, array $rules, array $messages = [], array $attributes = [])

Validate the given request with the given rules.

getValidationFactory()

Get a validation factory instance.

Details

array validateWith(Validator|array $validator, Request|null $request = null)

Run the validation routine against the given validator.

Parameters

Validator|array $validator
Request|null $request

Return Value

array

Exceptions

ValidationException

array validate(Request $request, array $rules, array $messages = [], array $attributes = [])

Validate the given request with the given rules.

Parameters

Request $request
array $rules
array $messages
array $attributes

Return Value

array

Exceptions

ValidationException

array validateWithBag(string $errorBag, Request $request, array $rules, array $messages = [], array $attributes = [])

Validate the given request with the given rules.

Parameters

string $errorBag
Request $request
array $rules
array $messages
array $attributes

Return Value

array

Exceptions

ValidationException

protected Factory getValidationFactory()

Get a validation factory instance.

Return Value

Factory