Skip to content

Guest Model ​

One person on one event. A guest row is the registration.

Guests are not WordPress users. A visitor registers with a name and an email only; a logged-in member's row also stores their user_id. calendar_id is a copy of the event's calendar, kept in step when the event moves, so calendar-wide counts need no join.

Class ​

  • Class: FluentEvent\App\Models\Guest
  • Table: {prefix}fe_guests
  • Primary key: id
  • Extends: Model
  • Source: fluent-event/app/Models/Guest.php

Attributes ​

ColumnTypeCastFillableDescription
idbigint(20) unsigned—No
event_idbigint(20) unsignedintYesThe event.
calendar_idbigint(20) unsignedintYesCopy of the event's calendar_id.
ticket_type_idbigint(20) unsigned—NoReserved for ticketing. Always NULL today.
group_idvarchar(64)—YesRandom 32-character order ID. Rows that share it are one order.
is_buyertinyint(1)intYes1 on the row that carries the order. Every RSVP or open registration is its own order, so it is 1 today.
namevarchar(255)—YesName the guest gave, or the member display name.
emailvarchar(191)—YesEmail address. Unique per event.
user_idbigint(20) unsignedintYesThe WordPress user, when a logged-in member registered or an admin linked one. Unique per event.
statusvarchar(64)—Yesgoing, not_going, checked_in or cancelled. Guests answer only going or not_going; only an admin sets checked_in or cancelled.
hashvarchar(64)—NoReserved for per-ticket links.
checked_in_atdatetime—YesWhen the guest was checked in. Cleared when the status leaves checked_in.
payment_statusvarchar(64)—Nopaid | unpaid | refunded
payment_refvarchar(255)—No
pricedecimal(10,2)—No
paid_atdatetime—No
sourcevarchar(64)—YesWhere the row came from: manual (admin), wordpress_pages (the public event page) or fluent_community (a member or a visitor on the portal).
source_idbigint(20) unsigned—YesID in the source system, for example the FluentCommunity post ID.
metalongtextarrayYesOpen-ended JSON for per-guest data.
created_attimestamp—No
updated_attimestamp—No

Mass assignment

Only the columns marked Fillable can be set through create() or fill(). ticket_type_id, hash, payment_status, payment_ref, price, paid_at are not fillable.

Computed Attributes ​

AttributeAppended to JSONDescription
avatarYesGravatar URL for the user, or for the email when there is no user.

Constants ​

ConstantValueMeaning
Guest::STATUSES"going,not_going,checked_in,cancelled"Every guest status.
Guest::DEFAULT_STATUS"going"The status a new guest gets when none is given.

Relationships ​

MethodTypeRelated ModelKeys
event()belongsToEventevent_id → id

Scopes ​

ScopeParametersDescription
searchBy()$searchMatches name or email with LIKE.
byStatus()$statusLimits to one status.

Usage ​

php
use FluentEvent\App\Models\Guest;
use FluentEvent\App\Models\Event;

// Everyone holding a seat at event 42.
$guests = Guest::query()
    ->where('event_id', 42)
    ->whereIn('status', Event::SEAT_STATUSES)
    ->orderBy('name')
    ->get(['id', 'name', 'email', 'status']);

FluentEvent developer documentation