ValidatesRequests

trait ValidatesRequests (View source)

Methods

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

Run the validation routine against the given validator.

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

Validate the given request with the given rules.

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

Validate the given request with the given rules.

Factory getValidationFactory()

Get a validation factory instance.

Details

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

Run the validation routine against the given validator.

Parameters

Validator|array $validator
Request $request

Return Value

array

Exceptions

ValidationException

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

Validate the given request with the given rules.

Parameters

Request $request
array $rules
array $messages
array $customAttributes

Return Value

array

Exceptions

ValidationException

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

Validate the given request with the given rules.

Parameters

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

Return Value

array

Exceptions

ValidationException

protected Factory getValidationFactory()

Get a validation factory instance.

Return Value

Factory

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Foundation/Validation/ValidatesRequests.html