The Resources System
ODR supports the association of resources to items. The most commonly used resources are pictures. Other resources include pdfs, excel sheets, 3D models, etc. Each resource is "associated" or "refernces" one or more items. For example, a "picture" resource can depict a single area, a few areas, or an area with a few loci in it. In other words, there are "many to many polymorphic" relationships between resources and items.
Resources are divided into two types: internal and external.
Internal resources These are "owned" and managed by the software. The resources themselves are stored on a S3 compatible object storage (DigitalOcean's "space") "owned" by the ODR. We use Spatie’s Laravel Medialibrary package to interact with the "space". Spaties' package manages the addition (upload) and deletion of resources, in addition to assigning attributes to them - for example assigning each reasource to a group (e.g., Photo, Drawing, Plan). Spaties' package doesn't support many to many polymorphic relationships. Those are implemented by the MediaItem model and its related tables.
External resources These resources are found on the web, hopefully on stable urls. The application maintains and manages only the associaction of these resources` urls to specific items. These associations are implemented by the WebResource model and its related tables.