So I am developing a web page where people can buy some t-shirts, and they can choose colors, size, and quantity, the problem is, that the user can edit the size and color on html source, so I need to validate if the size match with enum on database and the color with the colors available on the table! I need to do this on request validation, and so far I have this:
return [
'tam' => 'required',
'color' => 'required',
'quantity' => 'required|numeric|min:1|max:20',
];
And the page has this:
Database enum has this:
with the "tamanho" field as enum, how can I verify if the "tamanho" on webpage is one of the enum values from database