Skip to content

Booking Model ​

Represents an individual booking (appointment) created when an attendee schedules time on a calendar.

Class ​

  • Source: fluent-booking/app/Models/Booking.php
  • Table: fcal_bookings
  • Primary key: id
  • Extends: Model

Attributes ​

ColumnTypeNullableDefaultDescription
idBIGINT(20) UNSIGNED NOT NULL PRIMARY KEYYes—Primary key for the row.
hashVARCHAR(192)Yes—Random hash used as a public, non-enumerable booking identifier.
calendar_idBIGINT(20) UNSIGNEDNo—Foreign key to fcal_calendars.
event_idBIGINT(20) UNSIGNEDNo—Foreign key to fcal_calendar_events (the CalendarSlot model).
group_idBIGINT(20) UNSIGNEDYes—Shared group ID for bookings created together (group / collective).
fcrm_idBIGINT(20) UNSIGNEDYes—Optional FluentCRM contact ID for the booker.
parent_idBIGINT(20) UNSIGNEDYes—Parent row used for rescheduled or grouped bookings.
host_user_idBIGINT(20) UNSIGNEDYes—WordPress user ID of the host that owns the booking.
person_user_idBIGINT(20) UNSIGNEDYes—WordPress user ID of the attendee, if they were logged in.
person_contact_idBIGINT(20) UNSIGNEDYes—FluentCRM contact ID for the attendee, when available.
person_time_zoneVARCHAR(100)Yes—IANA timezone of the attendee at the time of booking.
start_timeTIMESTAMPYes—Booking start time in UTC.
end_timeTIMESTAMPYes—Booking end time in UTC.
slot_minutesINT(11) UNSIGNEDNo—Length of the booked slot in minutes.
first_nameVARCHAR(192)Yes—Attendee first name.
last_nameVARCHAR(192)Yes—Attendee last name.
emailVARCHAR(192)Yes—Attendee email address.
messageTEXTYes—Free-form message submitted by the attendee.
internal_noteTEXTYes—Internal note visible only to hosts and admins.
phoneVARCHAR(100)Yes—Attendee phone number (when collected).
countryVARCHAR(100)Yes—Attendee country code (when collected).
ip_addressVARCHAR(192)Yes—IP address recorded when the booking was created.
browserVARCHAR(192)Yes—Browser detected when the booking was created.
deviceVARCHAR(192)Yes—Device detected when the booking was created.
other_infoLONGTEXTYes—Serialized custom-field answers and miscellaneous attendee data.
location_detailsLONGTEXTYes—Serialized location data (Zoom link, address, custom location).
cancelled_byBIGINT(20) UNSIGNEDYes—User ID of the person who cancelled the booking, if any.
statusVARCHAR(20)NoscheduledLifecycle status (scheduled, cancelled, completed, rejected, pending).
sourceVARCHAR(20)NowebHow the booking was created (web, api, etc.).
booking_typeVARCHAR(20)NoschedulingInternal booking subtype.
event_typeVARCHAR(20)Nosinglesingle or group event.
payment_statusVARCHAR(20)Yes—Payment lifecycle status (pending, paid, refunded).
payment_methodVARCHAR(20)Yes—Selected payment method slug.
source_urlTEXTYes—Referring URL where the booking originated.
source_idBIGINT(20) UNSIGNEDYes—Generic foreign key for the source record (form ID, etc.).
utm_sourceVARCHAR(192)Yes``Marketing UTM source value.
utm_mediumVARCHAR(192)Yes``Marketing UTM medium value.
utm_campaignVARCHAR(192)Yes``Marketing UTM campaign value.
utm_termVARCHAR(192)Yes``Marketing UTM term value.
utm_contentVARCHAR(192)Yes``Marketing UTM content value.
created_atTIMESTAMPYes—Creation timestamp maintained by the ORM.
updated_atTIMESTAMPYes—Update timestamp maintained by the ORM.

Relationships ​

MethodTypeTarget
calendar()belongsToCalendar
slot()belongsToCalendarSlot
calendar_event()belongsToCalendarSlot
booking_meta()hasManyBookingMeta
booking_activities()hasManyBookingActivity
user()belongsToUser
hosts()belongsToMany$class
bookingHosts()hasManyBookingHost
payment_order()hasOneOrder

Query Scopes ​

ScopeParameters
WhereHostAccess$query, $userId
Upcoming$query
Past$query
ApplyDateRangeFilter$query, $range
ApplyComputedStatus$query, $status
ApplyBookingOrderByStatus$query, $status
SearchBy$query, $search

Public Methods ​

MethodSignature
calendar()—
slot()—
calendar_event()—
booking_meta()—
booking_activities()—
user()—
assignNextGroupId()—
getCustomFormData()$isFormatted = true, $isPublic = false
getHostTotalBooking()$eventId, $hostIds, $ranges
getAdditionalGuests()$isHtml = false
getTotalGuestCount()—
getHostEmails()$excludeHostId = null
hosts()—
getHostIds()—
bookingHosts()—
getFullBookingDateTimeText()$timeZone = 'UTC', $isHtml = false
getPreviousMeetingDateTimeText()$timeZone = 'UTC'
getShortBookingDateTime()$timeZone = 'UTC'
getPreviousMeetingTime()$timeZone = 'UTC'
getAttendeeStartTime()$format = 'Y-m-d H:i:s'
getAttendeeEndTime()$format = 'Y-m-d H:i:s'
getOtherBookingTimes()—
getAllBookingShortTimes()$timeZone = 'UTC', $withTimeZone = false
getAllBookingFullTimes()$timeZone = 'UTC', $withTimeZone = false
getHostAndGuestDetailsHtml()—
getLocationDetailsHtml()—
getLocationAsText()—
getMessage()—
setLocationDetailsAttribute()$locationDetails
getLocationDetailsAttribute()$locationDetails
setOtherInfoAttribute()$otherInfo
getOtherInfoAttribute()$otherInfo
getOngoingStatus()—
getBookingStatus()—
getPaymentStatus()—
payment_order()—
getCancelReason()$isText = false, $isHtml = false
getRejectReason()$isText = false, $isHtml = false
addCancelOrRejectReason()$title, $reason, $type = 'cancel_reason'
cancelMeeting()$reason = '', $cancelledByType = 'guest', $cancelledByUserId = null
rejectMeeting()$reason = '', $rejectByUserId = null
getRescheduleReason()$html = false
getBookingTitle()$html = false
getActivities()—
updateMeta()$key, $value
deleteMeta()$key
getMeta()$key, $default = ''
getRedirectUrlWithQuery()—
getConfirmationUrl()—
getAdminViewUrl()—
getIcsDownloadUrl()—
getRescheduleUrl()—
getCancelUrl()—
hasBookingAccess()—
canCancel()—
canReschedule()—
isMultiGuestBooking()—
isRoundRobinBooking()—
isMultiHostBooking()—
isRecurringBooking()—
getHostProfiles()$public = true
getInviteePhoneNumber()$calendarEvent
getCancellationMessage()—
getRescheduleMessage()—
getHostDetails()$isPublic = true, $hostId = null
getHostsDetails()$isPublic = true, $excludeHostId = null
getHostTimezone()—
getCalendarLinkDescription()—
getIcsBookingDescription()—
getAdditionalData()$isHtml = false
getConfirmationData()$html = false
getMeetingBookmarks()$assetsUrl = ''