Units
Intro
Units are the building blocks of courses, where a course is a collection of units.
A unit itself is a collection of lessons.
The structure of a unit is as follows:
- A name
- A description
- An image
- A published status (1 = published, 0 = draft)
- Multiple lessons via the lessons relationship
Units are soft-deletable, so they can be restored if they are deleted by mistake. It is important to note this when querying units to be displayed in the app.
Managing Units
Units are managed within the filament creator panel of the app. A unit menu item is there.
In the units menu item, you can:
- Create a new unit
- Edit an existing unit
- Delete an existing unit
- Add lessons to units and order the lessons within the unit
- See which courses a unit is linked to
Unit Items
Unit Items are a polymoprphic many-to-many relationship between units and other models.
This relationship was built with the intention of allowing multiple models (lessons and elements to start) to be attached to units. However, at the moment, only lessons can be attached to units in the admin area, as elements are not yet built.
Attaching lessons to units
Lessons can be attached to units via the lessons relation manager.
Within the relation manager, lessons can be ordered within the unit.
Attaching units to courses
Units can be attached to courses via the units relation manager on the course edit page.
Within the relation manager, units can be ordered within the course.
Again the reason that units are attached to courses via the units relation manager is because the units must be ordered correctly within the course and this is best done in the course edit page.