Data models
Schema reference scope
This guide maps the current model families, ownership and selected relationships. It is not a migration dump, complete database schema, API field allowlist or authorization policy. Read the current model, migrations, serializer/controller and module guide together before adding or exposing a field.
The retained static index records named classes and relationship-constructor calls from app/Models without booting Laravel or connecting to a database. It deliberately does not resolve imported aliases, inherited/trait methods, dynamic targets, query conditions or runtime scopes. An absent constructor in that index does not prove a relationship is absent; aliases and helper methods can delegate to another relation. Source commits/hashes and review evidence live in the documentation repository.
Overview
Team/project context organizes many features, but not every model has a direct project_id, and a relationship is not a tenant-isolation policy. Some definitions/settings are team/global resources, some models are pivots or authentication identities, and some relationships are polymorphic or through another owner. For example, IntegrationToken supports an explicit is_global flag and corresponding scoped-query behavior; a missing team/project foreign key is not a universal definition of global access. Eager loading is chosen by each request/query; defining a relationship does not automatically prevent N+1 queries.
| Family | Current starting points | Behavior and acceptance guide |
|---|---|---|
| Platform identity and access | Admin, Team, Membership, Role, Permission, model permission/role pivots | Authentication, authorization |
| Project composition | Project, reusable plugin definitions/versions, project pages/portals/dashboards | Ecosystem, project resources (repository reference: ../../developer-tools/getting-started/project-resources.md) |
| Attendee data | Attendee, types, fields/order/sections, groups/memberships, credentials | Attendee registration |
| Forms, surveys and quizzes | ProjectForm, sections/fields, specialized settings, responses, quiz attempts/answers | Survey, quizzing |
| Collections | Collection, fields/sections/layouts, entries/assets | Collections |
| Agenda and access | AgendaItem, enrollment/location/type models, access points/readers/rules/scans | Agenda (repository reference: ../../developer-tools/getting-started/agenda-and-enrollment.md), devices |
| Content and engagement | Social streams/posts, games/sessions/point transactions, journeys | Social streams, games |
| Messaging and notification | Chat rooms/sessions/participants/messages, templates/versions, delivery logs | Chat, notifications |
| AI, media and workflows | Interfaces/models/prompts/sessions, media events/assets, workflow versions/executions/steps | AI drivers, Gemini Live, automation (repository reference: ../../developer-tools/getting-started/communication-and-ai.md) |
| Import, export and integrations | Import rows/cells/raw data/errors, export logs/downloads/grants, integration tokens | Importer, exporter, integrations |
| Supporting platform resources | Subscriptions/items/coupons, assets, tags, saved searches, webhook delivery, audit/event records | Billing, module index, auditing |
Core platform
Arrows name selected source relationships, not enforced database cardinality or complete access paths.
Adminextends Laravel’s authenticatable base; it is the platform admin identity.Attendeeis a distinct authenticatable model. Do not substitute an assumed applicationUsermodel for either context.Team::admins()usesMembershipand itsteam_adminpivot table. Current team, team ownership and membership are different relations/attributes; the team context is not a complete permission grant.Role::permissions()usesrole_has_permissions; model role/permission assignments useModelHasRoleandModelHasPermissionmorph pivots. Roles carry team/guard-group context. Assignments identify a polymorphic model and can carry project scope; direct permission assignments also carry team context. Guard grouping uses the currentguard_group_namecontract. Inspect effective resolution rather than treating the Team→Role arrow as the complete assignment rule.Project::team()is a direct belongs-to relation. Project dates arestarting_atandending_at; consult its validation rules and casts instead of copying the oldstarts_at/ends_atdiagram.- Project permissions, global definitions and system actions require their actual context. The default Developer role (repository reference:
../../developer-tools/getting-started/permissions-and-dependencies.md) does not grant every project mutation.
HasTeams provides admin membership/current-team behavior. It is not a universal Eloquent global tenant scope. Middleware, policies, service lookups and endpoint constraints remain separate. See architecture context boundaries.
Attendee domain
| Model/method | Declared relationship |
|---|---|
Attendee::project, attendeeType | Belongs to Project and AttendeeType. |
Attendee::groups | Many-to-many Group using AttendeeGroupMembership; pivot includes role, custom sort order and metadata/timestamps. |
Attendee::credentials | Has many AttendeeCredential. |
Attendee::formResponses, quizAttempts | Has many recorded responses and attempts; workflow authorization is separate. |
Attendee::agendaEnrollments, enrolledAgendaItems | Enrollment records and many-to-many agenda items. |
Attendee::assets, encryptedValues | AttendeeAsset and AttendeeEncryptedValue records. |
AttendeeType::attendees | Has many Attendee. |
Group::attendees | Many-to-many Attendee; Group also links project, permission rules and optional saved search. |
AttendeeCredential::attendee, credentialType, project | Direct owning attendee/type/project relations. |
AttendeeCredential::attendeeCredentialScans, printJobs | Scans and polymorphic print jobs. |
AttendeeCredentialType::badgeTemplate | Selected BadgeTemplate association. |
Profile fields can live in attendee_fields JSON with model accessors; a displayed first name/email is not necessarily a standalone column. The model’s hidden declaration covers the raw JSON and selected authentication-secret fields by default, while specific API/serializer paths can expose allowed projections. A $hidden declaration is not a substitute for field-level endpoint permissions, and an accessor is not an API write contract.
Field definitions and ordering use AttendeeField, AttendeeFieldTranslation, AttendeeTypeFieldSection and AttendeeFieldOrder. Inspect type/field configuration and actual import/update rules before writing dynamic values. Group membership and its cached permission evaluation have lifecycle/invalidation behavior; bulk/query-builder writes may bypass the expected model path. Do not infer a refreshed permission/audience result from an arbitrary pivot-table update.
Identity and credential lifecycle are distinct from registration, login, check-in and enrollment. Use the corresponding module operation rather than treating a relation assignment as the whole workflow.
Forms and content
ProjectForm owns sections(), fields(), responses() and registration-related configuration, and can reference a PluginPage/PluginPageVersion. Relational FormSection can contain child sections and fields; FormField belongs to its form and section.
For graph-backed layouts, ProjectForm stores separately cast root_config, cards_config and elements_config, with layoutGraph() exposing root/cards/elements. Raw graph columns are hidden from normal serialization; an owning controller can provide form_definition. Admin/Project/ProjectFormController::show chooses native layout through usesLayoutEngine()/layoutGraph(), or calls FormSchemaTranslatorService::translateV1ToV2 unless a locked template supplies the definition. Use that service’s section/field conversion and the actual response/write service as the starting point for graph-to-relational ID mapping; no universal identity mapping is implied. An Eloquent read does not automatically migrate every form to one format.
Specialized forms and recorded answers
SurveySettingsandQuizSettingsextendProjectFormand useproject_forms, with specialized JSON-backed settings accessors. They are not each a separate form table.FormSectioncarries quiz-bank settings incustom_settings;quizQuestions()filters its fields by the quiz-question flag. Bank grouping, active/live state and scoring still belong to the quiz service/API contract.QuizQuestionSettingsis a separate model withproject_form_id,element_idand scoring/correct-answer settings. ItsprojectForm()andquizSettings()relations use the form identity; do not assume a physical question row for every graph element.QuizAttemptlinks form, attendee, optional game/live/section contexts andanswers().QuizAttemptAnswerrecords attempt answers. A form response and a scored quiz attempt are different records/workflows.AttendeeFormResponselinks project/form, optional attendee, response values and a polymorphic subject. Its fields include metadata/attribution and visitor/session context. A nullable attendee relation alone does not establish complete anonymity or define which response fields a public API may return.AttendeeFormResponseValuebelongs to a response and FormField. Inspect the version-specific response mapping and service before interpreting graph element IDs as relational field IDs.
Use forms/surveys, registration, quizzing and the actual portal API schema. A client-rendered required field, submit button or results setting does not enforce server validation or privacy.
Portal and plugins
| Model | Selected relationships and role |
|---|---|
PluginPage | Definition: team, variants, versions, current/active versions, Git repository, development/planning sessions and installed project pages. |
PluginPageVariant | Definition ownership and default/develop/production/scoped version lookup; names alone do not establish publication state. |
PluginPageVersion | PluginPage, variant, build artifact, assets and project installations. |
GitRepository | Plugin page/theme owner, collaborators, build artifacts and pull requests. |
GitBuildArtifact | Repository and optional PluginPageVersion linkage. Build success does not imply installation. |
ProjectPage | Project-level app installation with PluginPage and version relations. |
ProjectPortal | Project, domains, content links, theme/version, widgets and authentication-method associations. |
ProjectPortalPage | Portal content link; projectPage() and model() are named polymorphic accessors over the same model_type/model_id pair, not independent stored associations. |
ProjectPortalDomain | Portal-domain mapping; use the custom-domain workflow for actual routing/TLS availability. |
ProjectPortalWidget | Portal widget attachment, separate from the reusable widget definition/version. |
ProjectDashboard, DashboardTile | Dashboard and installed tile context, separate from PluginTile/PluginTileVersion. |
PluginPlan | Team/template/build/planning relationships and reusable provisioning configuration. |
Themes, widgets, tiles and external apps have their own definition/version/asset models. App variants/builds do not imply identical release behavior for all types. Bind the installed version, named dependencies and portal content/access rules explicitly; a model relation or installed portal-page API key is not an unlimited attendee authorization grant. Page keys provide supported runtime/API context; see API keys for credential boundaries.
Use portal architecture, developer workflow, app configuration (repository reference: ../../developer-tools/getting-started/app-configuration.md), custom domains and App Store.
Collections
Collection owns project-scoped fieldDefinitions(), sections(), formLayouts(), entries() and assets(). The corresponding models include CollectionFieldDefinition, CollectionSection, CollectionSectionField, CollectionFormLayout, CollectionEntry and CollectionAsset.
CollectionEntry belongs to its collection and project, casts data to an array, and has a polymorphic submittedBy() relation. A polymorphic submitter is not guaranteed to be an attendee. Schema definitions, entry JSON, form layout, visibility/tags and API import/export behavior are separate contracts. Use Collections and validate actual field identifiers/data shapes and allowed submitter/resource access before creating entries.
Access, agenda and security
| Model/method | Ownership or related records |
|---|---|
AgendaItem | Project, type, locations, access zones, enrollments and speaker group. |
AgendaItemEnrollment | Agenda item, attendee, optional location/credential and enrolling admin. |
AccessPoint | Project/location with readers, rules, statuses and credential scans. |
AccessPointReader | Project, point/zone, reader OTPs, scans, location and access-code logs. |
AttendeeCredentialScan | Access point, reader, credential, attendee, agenda item and access status. |
BadgeTemplate | Project/team, current/latest/version records and credential types. |
BadgeTemplateVersion | Template, publisher and assets. |
PrintJob, PrintAuditLog | Print workflow records; inspect polymorphic printable context, device delivery and audit behavior. |
An enrollment, a credential scan and an event check-in are distinct mutations. Capacity, location, validity, reader authentication and denied access belong to their services/policies. Creating a PrintJob does not prove a physical badge printed. Follow agenda/enrollment (repository reference: ../../developer-tools/getting-started/agenda-and-enrollment.md), access control, devices and badge printing.
Engagement and gamification
SocialStream belongs to a project and owns posts. SocialStreamPost relates to its stream, attendee, polymorphic approver, tagged attendees and moderation logs; it reaches Project through the stream. Interpret the post’s actual status/assets/visibility with the social-stream contract, rather than assuming every record is publicly approved.
Game relates to project, attendees, groups, point rules, sessions and transactions. GameSession links game/attendee and point transactions. GameScore, GamePointRule, GameGroup, JourneyTemplate and JourneyProgress are additional feature models. A point transaction, score projection and completed journey are different facts; use the supported scoring/aggregation workflow. Like is a distinct model, not a universal bookmark abstraction for every resource.
See games and the feature’s actual scoring/privacy/leaderboard acceptance cases. Model presence does not establish every UI/game mode or hardware interaction.
Notifications and communications
NotificationTemplate can be associated with project/team, test group, versions, current/latest versions and assets. EmailSendConfiguration, NotificationEvent, AttendeeNotificationLog, EmailLog, SmsMessageLog, PushBroadcast, PushNotificationLog and PushSubscription support configured delivery/audit contexts. A queued/logged notification is not proof of provider delivery or attendee receipt; use notifications.
Chat is session-based: ChatRoom owns sessions/waitlist and can reference an AI interface; ChatRoomSession owns participants/messages/call metrics and can reference MediaSession. ChatMessage stores a room-session and sender-participant identity. Attachments/reactions and moderation flags have their own records/fields. Do not substitute a room ID for the session/participant contract. Use group chat and messaging.
Admin workflows, AI and media
AdminWorkflow relates to versions, a published version, steps/triggers, assets, team/project, owner/test group and execution records. Its legacy executions() targets StoredWorkflow, while workflowExecutions() targets AdminWorkflowExecution. The run record is AdminWorkflowExecution; AdminWorkflowStepInvocation links a logical step invocation to it, and AdminWorkflowStepAttempt links an attempt to the invocation. AdminWorkflowBatchManifest and AdminWorkflowBatchMember hold batch context; the execution/manifest correlation is not universally a migration-enforced foreign key. Distinguish these from definition/version and external delivery. Use the automation run guide and action reference.
AiInterface belongs to project and relates to AiPrompt, SystemAiModel and sessions. AiSession links interface, attendee, messages, optional workflow-step invocation and MediaSession; its project relation is through the interface. AdminAiSession/AdminAiSessionMessage are separate admin-facing conversation models. System/model/provider configuration and credential scoping are separate from a conversation’s persisted messages.
MediaSession owns participants, events and assets, and can link AI sessions and a ChatRoomSession. Transcription/event/asset metadata is not proof that audio was stored, callback authentication succeeded or a file is usable. Use AI configuration, AI drivers, Gemini Live, and communication/automation setup (repository reference: ../../developer-tools/getting-started/communication-and-ai.md).
Import, export and sync
Import has project/team, polymorphic owner/reviewer, rows, cells, raw data, job errors and optional IntegrationToken. Use ImportRow, ImportCell, ImportRawData and ImportJobError with the current stage/run/chunk contract. Importable model rules and the staged importer determine validation and duplicate matching; a static diagram of generic log/mapping tables is not that contract.
ExportLog relates to admin/team/project, downloads and workflow recipient grants. AttendeeExportLog/AttendeeExportLogDownload provide a separate attendee export context. Authorization for generated files and download grants must be tested; an export log is not a public URL or completed file-delivery guarantee.
IntegrationToken can relate to admin/project/team/social stream. Its credentials field uses an encrypted-array cast and sensitive values are hidden from serialization; this does not make every API projection/config/log safe automatically. Server integrations use IntegrationToken::credential($key) for encrypted secrets and configValue($key) for non-secret configuration. Do not copy their secret results into docs or client bundles.
The sync registry/builders, request/context DTOs and jobs live outside a universal SyncProvider model. Inspect the sync architecture, importer, exporter and integration guide for actual persistence and retry/ownership behavior. Do not infer a bidirectional mapping table or identical lifecycle for every adapter.
Key Eloquent traits and serialization
| Trait/pattern | Read it as |
|---|---|
HasTeams | Membership/current-team operations on supported identities; not a universal tenant scope. |
Cacheable | Configured cache lookup/invalidation behavior where used; not automatic caching of every model or write path. |
AdvancedSearchable | Saved-search/advanced-query behavior via the platform search service; distinct from Scout indexing. |
HasAdvancedFilters | Supported query filtering with per-model/request constraints; not a permission grant. |
HasRolesAndPermissions | Supported permission/role context and assignments; inspect scope and cache invalidation. |
Importable | Model import configuration/lifecycle integration; not arbitrary file import support. |
Uploadable, signed asset helpers and asset relations | Storage/URL behavior for supported resources; authorization and delivery remain separate. |
AiModeratable, PluginProps, ObservableTrait | Selected feature behavior where declared and invoked; no universal mutation/event guarantee. |
Casts, fillable/guarded/hidden arrays, accessors and computed API projections describe different layers. A fillable property need not be accepted by an endpoint; a hidden property may have an explicitly allowed projection elsewhere. Check migrations for storage constraints and requests/controllers/policies for mutation and exposure rules. Avoid documenting every model as soft-deletable, directly project-owned or identically timestamped.
Observers, caches and safe changes
Observers can be registered in providers, attributes or individual model boot methods. Inspect registration and the actual write path; not every observer is registered in EventServiceProvider, runs cache invalidation first, or queues heavy work. Raw/bulk/query-builder operations and custom pivot paths may bypass ordinary model hooks.
Before changing a relationship or field, trace the owning endpoint, database constraints, casts/accessors, serialization, events/observers, cache invalidation, import/export mappings and background jobs. Check the real service/cache contracts, event architecture, auditing and module acceptance cases.
| Symptom | Inspect |
|---|---|
| A relation returns another project’s data | Parent lookup, route/context constraints, policy and related-query scoping; the method name alone is not isolation. |
| A field is missing or has a different shape | Stored column versus JSON accessor, casts, hidden fields, serializer projection and versioned schema. |
| Permissions/groups appear stale | Supported membership/role mutation path and cache invalidation; compare direct/bulk writes. |
| Form/quiz IDs do not align | Form version, graph element versus relational field mapping, settings and response/attempt workflow. |
| Chat content is missing from a room query | Room session and participant/message ownership, not just room identity. |
| A saved record did not trigger downstream work | Actual observer/event registration and dispatch path, queues and provider results. |
| A file/export/print record exists but output is absent | Storage/URL/job status, authorization, provider/device delivery and final receipt. |
Source and validation
Reviewed at platform commit 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093, combining a static class/relationship index with direct inspection of the documented ownership, casts, settings inheritance, core pivots and trait boundaries. The indexer uses PHP tokenization in a network-disabled container, with synthetic fixtures checking comment/string exclusion, traits, polymorphic/dynamic targets and branch calls. It does not instantiate models, run SQL, prove migration foreign keys or certify all authorization/runtime paths.
The repository retains the static index, extractor, fixture/reproduction notes, source snapshot and review report. Module-specific backend persistence, allowed/denied queries, graph migrations, lifecycle/invalidation and output delivery remain environment acceptance checks. A strict docs build and static index are source evidence, not a deployed-database audit.