Model Relationships
FluentBooking models use the standard WPFluent relationship helpers — belongsTo, hasMany, hasOne, belongsToMany, and morph variants. The table below is parsed directly from each model class so it stays in sync with the source.
| Model | Method | Type | Target |
|---|---|---|---|
| Booking | calendar() | belongsTo | Calendar |
| Booking | slot() | belongsTo | CalendarSlot |
| Booking | calendar_event() | belongsTo | CalendarSlot |
| Booking | booking_meta() | hasMany | BookingMeta |
| Booking | booking_activities() | hasMany | BookingActivity |
| Booking | user() | belongsTo | User |
| Booking | hosts() | belongsToMany | $class |
| Booking | payment_order() | hasOne | Order |
| Calendar | slots() | hasMany | CalendarSlot |
| Calendar | events() | hasMany | CalendarSlot |
| Calendar | user() | belongsTo | User |
| Calendar | bookings() | hasMany | Booking |
| Calendar | availabilities() | hasMany | Availability |
| Calendar | metas() | hasMany | Meta |
| CalendarSlot | calendar() | belongsTo | Calendar |
| CalendarSlot | bookings() | hasMany | Booking |
| CalendarSlot | user() | belongsTo | User |
| CalendarSlot | event_metas() | hasMany | Meta |
| BookingActivity | booking() | belongsTo | Booking |
| BookingHost | booking() | belongsTo | Booking |
| BookingMeta | booking() | belongsTo | Booking |
| Meta | calendar_event() | belongsTo | CalendarSlot |
| Staff | user() | belongsTo | User |
| User | calendars() | hasMany | Calendar |
| User | bookings() | belongsToMany | CalendarSlot |
| User | staff() | hasOne | Staff |
| Order | items() | hasMany | OrderItems |
| Order | discounts() | hasMany | OrderItems |
| Order | transaction() | hasOne | Transactions |
| Order | booking() | belongsTo | Booking |