Pixelairport's avatar

Where to put a check "Does relation exists"

Hi. Did anybody know, where to put the code, that checks if a relation is correct before storing into session. For example I have survey, which has topics, which has answers. Now User clicks something (js) and sends the data back (survey_id, topic_id, answer_id). I wanted to check i the answer id is part of topic and survey. I first thought about a new validation rule, but this is more for a single value. Then I thought to put it in my Actions and that sounds best for me at this time. But maybe somebody has a better Idea. I first want to check and then store it into session.

ps: with Actions i mean a folder where i have classes with actions like (calculateSurvey, ...) I use it like jetstream or fortify do.

0 likes
0 replies

Please or to participate in this conversation.