Broad Database Overview
High-level concepts: models, relationships, migrations, and request helpers
Major Entities (Models)
Key models power public websites and content features:
Public Website
- PublicProfile: top-level site container (slug, branding)
- PublicPage: per-profile pages (title, slug, menus)
- PageSection/SectionTemplate/SectionVariable/SectionVariableValue
Content
- Blog, Post, Comment, PostLike
- Podcast, Episode
- EventList, Event
- Poll, PollOption, PollResponse
- Media, MediaList, MediaListItem, Tag
Subscriptions & Tokens
- Plan, PlanFeature, Subscription, SubscriptionPayment
- TokenPackage, TokenPurchase, TokenUsageLog
Notifications & Analytics
- NotificationSubscription, NotificationMessage
- ProfileAnalytics, UserActivityLog
Relationships
Public Profiles ↔ Pages
PublicProfile↔PublicPage: many-to-many viapublic_profile_public_pagepivot- Pivot fields:
is_default,order; access viapublicPages()/publicProfiles() - Convenience:
defaultPublicPage()(profile) and ordered associations on both sides
Pages → Sections → Variables
PublicPagehasManyPageSection(sections(),activeSections())PageSectionbelongsToPublicPage,SectionType,SectionTemplate; optionalbackgroundMedia()PageSectionhas polymorphicvariableValues()→SectionVariableValueviasectionableSectionVariableValuebelongsToSectionVariable; exposesparsed_valuefor typed access
Profiles → ProfileSections
PublicProfilehasManyProfileSection(sections(),activeSections())SectionVariableValuecan also reference profile sections (legacy/back-compat) and uses the same polymorphic pattern
Blogs, Posts, Comments, Likes
BloghasManyPost; both support polymorphiccomments()(commentable)PosthasManyPostLike(likes()) and scopes (published(),featured())CommentmorphTocommentable; self-referencingparent()/replies(); hasManyCommentLike
Podcasts, Episodes, Taxonomy
PodcasthasManyEpisode,Season,RssFeed,PodcastView- Many-to-many:
contributors(),categories(),tags()with pivot tables - Polymorphic comments on
Podcastviacomments()/approvedComments()
Media & Playlists
MediaListhasManyMediaListItem(ordered playlists)MediabelongsToManyTagviamedia_tags; supports derived relations (e.g.,MediaClip)
Events & Notifications
EventListhasManyEventPublicProfilehasManyNotificationSubscription; messages sent viaNotificationMessage
Subscriptions & Plans
PlanhasManyPlanFeatureSubscriptionassociates users toPlanwith payments inSubscriptionPayment
Migrations Overview
Tables are created under database/migrations with timestamps. Notable groups:
- Public pages & sections: public_pages, page_sections, section_types, section_templates, section_variables, section_variable_values
- Content: blogs, posts, comments, post_likes; podcasts, episodes; events, event_lists
- Media: media, media_lists, media_list_items, media_tags, tags
- Engagement: polls, poll_options, poll_responses; surveys and related tables
- Monetization: plans, plan_features, subscriptions, subscription_payments; token_* tables
Controllers (Selected)
Controllers orchestrate dashboard CRUD and public rendering:
- Dashboard: Podcasts, Episodes, Transcriptions, Contributors, Tags, Studio
- Public: PublicProfileController, PublicPageController
- Media & Content: MediaController, BlogController, PostController, EventController
- Engagement: PollController, SurveyController, NotificationController
- Commerce: SubscriptionController, Admin controllers for plans/packages
Making Requests to the Server
Use global helpers from resources/views/layouts/app.blade.php:
GET: apiGet(url, options?)
POST: apiPost(url, data, options?)
PUT: apiPut(url, data, options?)
PATCH: apiPatch(url, data, options?)
DELETE: apiDelete(url, options?)
All send/expect JSON, include credentials, and accept extra headers via options.headers.
File uploads: apiFileUpload(url, FormData, { headers?, onProgress? }) with progress; or uploadFileAndCreateMedia(file, meta?, onProgress?) to create media via /api/media.
Useful Paths
- Routes:
routes/web.php - Models:
app/Models/* - Controllers:
app/Http/Controllers/* - Migrations:
database/migrations/* - Public help:
resources/views/public/help.blade.php