1. Create a Form Request class: Start by creating a Form Request class. This class will contain the validation logic for the request. To create a Form Request class, you may use the make:request Artisan command.
2. Define the rules: Once the class has been created, you may define the validation rules for the request using the rules method. This method should return an array of rules.
3. Customize the error messages: Next, you may customize the error messages used by the validator. To do so, add a messages method to your Form Request class. This method should return an array of attribute / rule pairs and their corresponding error messages.
4. Authorize the request: If you wish to authorize the request, you may call the authorize method from within the Form Request class. This method should return a boolean value indicating whether the user is authorized to make the request.
5. Validate the request: Finally, you may call the validate method to validate the incoming request against the given rules. This method should return a validator instance. If validation fails, an exception will be thrown.