Skip to content

⚡ CalendarSlot Model

The CalendarSlot model (also referred to as an "Event Type") defines the rules for specific appointment types, such as duration, location, and availability.

Attributes

AttributeTypeDescription
idbigintPrimary key
hashvarcharUnique identification hash
user_idbigintCreator's WordPress user ID
calendar_idbigintParent calendar ID
durationintEvent duration in minutes
titlevarcharEvent name (e.g., "30 Min Consultation")
slugvarcharEvent URL slug
media_idbigintFeatured image media ID
descriptionlongtextEvent description
settingslongtextJSON for notifications, ranges, and conditions
availability_typevarcharexisting_schedule / custom
availability_idbigintID for existing schedule availability
statusvarcharactive / inactive / draft / expired
typevarcharPayment type (free / paid)
event_typevarcharsingle, group, single_event, group_event, round_robin, collective
location_typevarchare.g., google_meet, zoom_meeting, in_person
location_headingtextCustom heading for location field
location_settingslongtextSerialized configuration for multiple locations
is_display_spotsbooleanWhether to show remaining spots for group bookings
max_book_per_slotintMax guests allowed per time slot
created_attimestampRecord creation time
updated_attimestampRecord last update time

Methods

getPublicUrl()

Returns the public booking URL for this specific event type.

isOneToOne() / isGroup() / isTeamEvent()

Check the event type category.

isRoundRobin() / isCollective()

Specific checks for Pro team-based event types.

isRecurringEvent()

Check if this event type supports recurring appointments.

getMeta($key, $default = null) / updateMeta($key, $value)

Manage event-specific metadata.

isConfirmationEnabled()

Check if bookings for this slot require manual host approval.

getBookingFields()

Returns the custom form fields defined for this event type.

getNotifications()

Retrieve the configured email notification settings.

getDuration($requestedDuration = null)

Returns the actual duration. Supports multi-duration lookups.

getDescription()

Returns a formatted description or default text if empty.

getSlotInterval()

Returns the interval between bookable slots (defaults to duration).

getMaxBookableDateTime($startDate)

Calculates the maximum date a guest can book based on range settings.

getHostIds()

Returns an array of WordPress User IDs assigned to this slot.

getLocationFields()

Returns available location options for editing.

getAuthorProfiles($public = true)

Returns an array of profiles for all hosts (team members) assigned to this event.

Relations

calendar

Returns the parent Calendar model.

bookings

Has many Booking records for this slot.

user

Belongs to the User who created the slot.

event_metas

Has many Meta records associated with this event.

Usage Examples

Getting the booking URL

php
use FluentBooking\App\Models\CalendarSlot;

$slot = CalendarSlot::find(5);
echo $slot->getPublicUrl();

Checking for Manual Confirmation

php
if ($slot->isConfirmationEnabled()) {
    // Notify admin that approval is required
}