When handling a request we want to easily verify, if our incoming data contains all the stuff we want and only the stuff we want. For this reason, FMVC utilizes the Dry::PHP library to validate request bodies against a predefined model.
For each action defined in
routes.php an individual model can be declared.
At first we need to define a model. Our validation models are being stored in
A property can be declared as either
optional. It is important to declare all optional fields as the validation will point out all additional fields occurring in the used payload, that are not being declared in the model it will validte against.