Validating web source information
trait which provides a convenient method to validate incoming HTTP request with a variety of powerful validation rules.
To learn about Laravel's powerful validation features, let's look at a complete example of validating a form and displaying the error messages back to the user.
For example, you may wish to require a given field only if another field has a greater value than 100.
Or, you may need two fields to have a given value only when another field is present.
Again, notice that we did not have to explicitly bind the error messages to the view in our function under the hood, ships with Laravel and is Laravel's pre-5.8 behavior.
For example, perhaps they run a game resale shop, or maybe they just enjoy collecting.
Internally, this rule uses the PHP patterns, it may be necessary to specify rules in an array instead of using pipe delimiters, especially if the regular expression contains a pipe character.
The field under validation must be present in the input data and not empty.
However, if the user only changes the name field and not the e-mail field, you do not want a validation error to be thrown because the user is already the owner of the e-mail address.
To instruct the validator to ignore the user's ID, we'll use the method.