Last updated
Last updated
The Request::validate()
response is optional. For example if you put a route parameter in the method, it will redirect to the route given with the error messages that validator collects. The other option is, if you are using an ajax call to direct request to the controller, you can leave the route paramerter to an empty ''
string.
If you use the empty route parameter, this will now redirected to any routes instead it returns a validationError
index with all the errors that the validator collects. This option is best for ajax calls because you can convert validationError
to json and return it back to the ajax and you can now do what ever you want to do with the data.