Database Models
OPBX uses Laravel Eloquent models. Most models are scoped by organization_id through OrganizationScope. Platform admin models are not tenant-scoped.
Model Reference Pages
Auto Dialer
- AutoDialerCampaign — Campaign configuration
- AutoDialerCampaignCallerId — Caller ID pool pivot
- AutoDialerCallerIdStat — Per-Caller ID statistics
- AutoDialerList — Distribution lists (
auto_dialer_lists) - AutoDialerDestination — List destinations (
auto_dialer_destinations) - AutoDialerListVersion — Previous versions of a list (
auto_dialer_list_versions) - AutoDialerListVersionDestination — Numbers of a previous version (
auto_dialer_list_version_destinations) - AutoDialerCallSession — Campaign call sessions (
auto_dialer_call_sessions)
Call & Logging
- CallDetailRecord — CDR from Cloudonix (
call_detail_records), with the warm-tierArchivedCallDetailRecord(archived_call_detail_records) - CallLog — Legacy call log, created by the
call-initiatedwebhook (call_logs) - SessionUpdate — Real-time session events (
session_updates) - CallNotificationsSettings — Webhook notification config (
call_notifications_settings) - CallNotificationLog — Notification delivery log (
call_notification_logs) - EmailLog — Transactional email log (
email_logs) - PlatformAuditLog — Cross-tenant audit trail (
platform_audit_logs) - PlatformHealthCheck — Platform Status history (
platform_health_checks)
Core PBX
- Extension — PBX extensions (
extensions) - DidNumber — Phone numbers (
did_numbers) - RingGroup — Ring groups (
ring_groups) - RingGroupMember — Ring group members (
ring_group_members) - IvrMenu — IVR menus (
ivr_menus) - IvrMenuOption — IVR options (
ivr_menu_options) - BusinessHoursSchedule — Business hours (
business_hours_schedules) - BusinessHoursScheduleDay — Schedule days (
business_hours_schedule_days) - BusinessHoursTimeRange — Time ranges (
business_hours_time_ranges) - BusinessHoursException — Exceptions (
business_hours_exceptions) - BusinessHoursExceptionTimeRange — Exception time ranges (
business_hours_exception_time_ranges) - BusinessHours — Legacy model on
business_hours_schedules; useBusinessHoursSchedule - ConferenceRoom — Conference rooms (
conference_rooms)
Call Queues
- CallQueue — Call queues (
call_queues) - CallQueueAgent — Queue agent membership (
call_queue_agents) - QueueCall — One row per queued call, for reports (
queue_calls)
Live queue state (positions, agent states) is not in MySQL; the ACD worker keeps it in Redis.
AI Integration
- AiAssistant — AI assistants (
ai_assistants) - AiAssistantLoadBalancer — Load balancers (
ai_assistant_load_balancers) - AiAssistantLoadBalancerMember — Load balancer members (
ai_assistant_load_balancer_members)
Recordings
- Recording — Audio files (
recordings)
Security
- InboundBlacklist — Blocked caller patterns (
inbound_blacklists), linked to numbers throughinbound_blacklist_did_number - OutboundWhitelist — Outbound routing rules (
outbound_whitelists) - BlockedCallLog — Log of blocked calls (
blocked_call_logs)
Users & Organizations
- User — User accounts (
users) - Organization — Multi-tenant organizations (
organizations) - CloudonixSettings — Cloudonix credentials per org (
cloudonix_settings) - OrganizationJoinRequest — Requests to join an organization (
organization_join_requests) - UserSocialIdentity — Linked Auth0 social identities (
user_social_identities) - UserEmbedToken — Embeddable dialer tokens (
user_embed_tokens) - Supervisor assignments (
supervisor_user_assignments,supervisor_ring_group_assignments) — pivot tables without a model, see Users and Organizations
API Access
- PersonalAccessToken — Sanctum tokens (
personal_access_tokens) - ApiKey — Organization API keys,
opbxk_prefix (api_keys) - ApiKeyPermission — Per-resource API key permissions (
api_key_permissions)
Framework Tables
These tables belong to Laravel and have no OPBX model: migrations, sessions, password_reset_tokens, cache, cache_locks, jobs, job_batches and failed_jobs. locks is used by App\Services\Fallback\DatabaseLockService, a database lock with an expires_at column.
Tenancy Notes
- Models with
#[ScopedBy([OrganizationScope::class])]are automatically filtered by the authenticated user's organization. - Webhook handlers and platform admin operations must use
OrganizationScope::bypass()when querying tenant-scoped models. - Not tenant-scoped:
Organization,PlatformAuditLog,PlatformHealthCheck,EmailLog,ApiKey,ApiKeyPermission,PersonalAccessToken,UserSocialIdentityand the child tables reached through a scoped parent (RingGroupMember,IvrMenuOption,AiAssistantLoadBalancerMember, the business-hours days, ranges and exceptions,AutoDialerCampaignCallerId,AutoDialerCallerIdStat). - Rows of several tables are pruned daily by retention settings; call records are tiered instead. See Data Retention.