5 months ago

Questions about Practical Validating/Sanitizing solution(s)

Posted 5 months ago by cemcminn
  1. If I use a class created with 'php artisan make:request' to record my validation rules, am I able to only have one 'request class' in my project? If not, I can't find the right idea of how to make multiple request classes to handle my various resource controllers. How is this usually done?

  2. Now the part of my question that relates to sanitizing inputs (with filter_var):

I saw a sample where someone added a sanitize method as a separate method in the request class and then validated the sanitized data with the 'rules' after it was sanitized. Is this a preferred method in Laravel?

Thank you.

Please sign in or create an account to participate in this conversation.