ValidatesRequests
trait ValidatesRequests
Properties
protected string | $validatesRequestErrorBag | The default error bag. |
Methods
Run the validation routine against the given validator.
Validate the given request with the given rules.
Execute a Closure within with a given error bag set as the default bag.
Throw the failed validation exception.
Create the response for when a request fails validation.
Get the key to be used for the view error bag.
Get the URL we should redirect to.
Get a validation factory instance.
Details
at line 28
void
validateWith(Validator|array $validator, Request $request = null)
Run the validation routine against the given validator.
at line 50
void
validate(Request $request, array $rules, array $messages = [], array $customAttributes = [])
Validate the given request with the given rules.
at line 71
void
validateWithBag(string $errorBag, Request $request, array $rules, array $messages = [], array $customAttributes = [])
Validate the given request with the given rules.
at line 85
protected void
withErrorBag(string $errorBag, callable $callback)
Execute a Closure within with a given error bag set as the default bag.
at line 103
protected void
throwValidationException(Request $request, Validator $validator)
Throw the failed validation exception.
at line 117
protected Response
buildFailedValidationResponse(Request $request, array $errors)
Create the response for when a request fails validation.
at line 134
protected array
formatValidationErrors(Validator $validator)
Format the validation errors to be returned.
at line 144
protected string
errorBag()
Get the key to be used for the view error bag.
at line 154
protected string
getRedirectUrl()
Get the URL we should redirect to.
at line 164
protected Factory
getValidationFactory()
Get a validation factory instance.