$this->validator->getValidated() looks stupid and unnecessary |
(10-09-2023, 07:51 AM)sammyskills Wrote: From the docs: I'm sorry but you reply doesn't make any sense to me. Of course, fields were not set in the validation rule set should not be trusted. It's a no brainer thing. And we do it intentionally sometimes, because there are some situations that we dont want some fields to be validated. And we know the fact that only the fields are in the validation rule set can be trusted. I think it's kinda unnecessary thing to use two different variables to access both valid data and unsure data like:, $validData = $this->validator->getValidated(); $validAndInvalidData = $this->request->getPost(); Instead the programmer can use only the $validAndInvalidData = $this->request->getPost(); and he/she should know what fields should be trust and what should not. Still If i'm missing somthing here. please correct me. I know I could be wrong. Thanks for the reply. |
Welcome Guest, Not a member yet? Register Sign In |