Level 4
I think I will abandon this solution via relationships.
I have following table structure:
Questionnaires -> Pillars -> Sections -> Questions
And it would be easy to define belongsToMany() relationships between tables to retrieve everything like this:
Questionnaire::with('pillars.sections.questions')->get();
Easy peasy.
Here comes the catch: There's an extra pivot table questionnaire_question that defines which questions questionnaire can have. So you cannot define relationship only between Sections->Questions because it also depends on current questionnaire.
Please or to participate in this conversation.