Skip to content

FAQ module overview

FAQ is essentially a set of question & answer pairs grouped into sections.

Tables

  • faq__sections: Sections group is a given set of FAQ questions. It also contains a description of the purpose of the section.
  • faq__questions: Questions with their respective answer.
  • faq__section_questions: It is the pivot table between questions and sections.

Sections

Every FAQ section has a name and description, and can have an order, in which will be listed on the main FAQ Page. The order can be changed using the respective Nova panel.

Questions

The questions are also listed on FAQ Page and can have order inside the section. A given question could belong to different sections and thus can be sorted per section: example.

Find Section with fallback

We use a custom Section::findOrMake(int $id) method to get an instance of the FAQ Section. This provides a fallback in case an IxDF staff member deleted a Section from the admin panel. It prevents breaking some pages where we use a code like $section = Section::query()->find(Section::SOME_TOPIC_ID).

The findOrMake() method helps us to not break the site but rather to notify developers about missing required data.